When I try to execute default unit tests which have been created with my
models, I get following errors.
CASE 1)
My default unit test file content;
>require ''test_helper''
>class UserTest < ActiveSupport::TestCase
> # Replace this with your real tests.
> test "the truth" do
> assert true
> end
>end
Commands that I executed;
>rake db:migrate
>rake db:test:load
>rake test:units --trace
(in /home/mustafakyr/Code/trunk/MyProject)
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:prepare
** Execute test:units
test/unit/user_test.rb:5:in `test'': unknown command
''t'' (ArgumentError)
from test/unit/user_test.rb:5:in `<class:UserTest>''
from test/unit/user_test.rb:3:in `<top (required)>''
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `load''
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `block in
<main>''
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `each''
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in
`<main>''
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I"lib:test"
"/usr/loc...]
/usr/local/lib/ruby/1.9.1/rake.rb:993:in `block in sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `call''
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1092:in `sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1027:in `ruby''
/usr/local/lib/ruby/1.9.1/rake.rb:1092:in `ruby''
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:26:in
`block (2 levels) in define''
/usr/local/lib/ruby/1.9.1/rake.rb:1110:in `verbose''
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:11:in
`block in define''
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `call''
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `block in execute''
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `each''
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `execute''
/usr/local/lib/ruby/1.9.1/rake.rb:595:in `block in
invoke_with_call_chain''
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize''
/usr/local/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain''
/usr/local/lib/ruby/1.9.1/rake.rb:581:in `invoke''
/usr/local/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in
top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `each''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling''
/usr/local/lib/ruby/1.9.1/rake.rb:2013:in `top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:1992:in `run''
/usr/local/bin/rake:31:in `<main>
CASE 2)
Then when I use following unit test file it is working, but when I get
an failure with test I get "rake aborted!" error.
My own unit test content;>require ''test_helper''
>class UserTest < ActiveSupport::TestCase
> # Replace this with your real tests.
> def test
> assert false
> end
>end
Commands that I executed;>rake test:units --trace
(in /home/mustafakyr/Code/trunk/MyProject)
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:prepare
** Execute test:units
Loaded suite /usr/local/lib/ruby/1.9.1/rake/rake_test_loader
Started
F
Finished in 0.115924 seconds.
1) Failure:
test(UserTest) [test/unit/user_test.rb:6]:
Failed assertion, no message given.
1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
Test run options: --seed 43445
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I"lib:test"
"/usr/loc...]
/usr/local/lib/ruby/1.9.1/rake.rb:993:in `block in sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `call''
/usr/local/lib/ruby/1.9.1/rake.rb:1008:in `sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1092:in `sh''
/usr/local/lib/ruby/1.9.1/rake.rb:1027:in `ruby''
/usr/local/lib/ruby/1.9.1/rake.rb:1092:in `ruby''
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:26:in
`block (2 levels) in define''
/usr/local/lib/ruby/1.9.1/rake.rb:1110:in `verbose''
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/test_unit/testing.rake:11:in
`block in define''
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `call''
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `block in execute''
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `each''
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `execute''
/usr/local/lib/ruby/1.9.1/rake.rb:595:in `block in
invoke_with_call_chain''
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize''
/usr/local/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain''
/usr/local/lib/ruby/1.9.1/rake.rb:581:in `invoke''
/usr/local/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in
top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `each''
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling''
/usr/local/lib/ruby/1.9.1/rake.rb:2013:in `top_level''
/usr/local/lib/ruby/1.9.1/rake.rb:1992:in `run''
/usr/local/bin/rake:31:in `<main>''
>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.9.1
- /home/mustafakyr/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
>gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.6)
authlogic (2.1.6)
builder (2.1.2)
bundler (1.0.7)
cgi_multipart_eof_fix (2.5.0)
daemon_controller (0.2.5)
daemons (1.1.0)
diff-lcs (1.1.2)
erubis (2.6.6)
eventmachine (0.12.10)
extlib (0.9.15)
fastthread (1.0.7)
ffi (1.0.4)
file-tail (1.0.5)
gem_plugin (0.2.3)
gga4r (0.9.2)
gravatar (1.0)
haml (3.0.25)
highline (1.6.1)
i18n (0.5.0)
mail (2.2.13)
mime-types (1.16)
minitest (1.6.0)
mysql (2.8.1)
mysql2 (0.2.6)
passenger (3.0.2)
pg (0.10.0)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
rdoc (2.5.8)
rubygems-update (1.4.1)
scaffold (0.0.3)
spruz (0.2.2)
sqlite3 (0.1.1)
sqlite3-ruby (1.3.2)
templater (1.0.0)
test-unit (2.1.2)
thin (1.2.7)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.23)
My default fixture file content;
# This model initially had no columns defined. If you add columns to
the
# model remove the ''{}'' from the fixture names and add the
columns
immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.