I want to run this simple test, but something is wrong. I don’t know how
to fix them! help!!
work_test.rb:
require File.dirname(FILE) + ‘/…/test_helper’
class WorkTest < Test::Unit::TestCase
fixtures :works
def setup
@work = Work.find(1)
end
Replace this with your real tests.
def test_create
assert_kind_of Work, @work
assert_equal 1,@work.id
assert_equal 3,@work.composer_id
assert_equal “The ruby Unit/test”,@work.title
end
end
works.yml:
Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
Create_ONE:
id: 1
composer_id: 3
title: The ruby Unit/test
line command:
ruby test\unit\work_test.rb
err:
Loaded suite test/unit/work_test
Started
E
Finished in 0.11 seconds.
- Error:
test_create(WorkTest):
Errno::ENOENT: No such file or directory - The ruby Unit/test
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:432:inreadlines' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:432:in
read_fixture_file’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:386:ininitialize' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:326:in
new’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:326:inread_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:321:in
each’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:321:inread_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:320:in
each’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:320:inread_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:281:in
initialize’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:251:innew' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:251:in
create_fixtures’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:250:inmap' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:250:in
create_fixtures’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/bas
e.rb:867:insilence' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:248:in
create_fixtures’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:593:inload_fixtures' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix tures.rb:538:in
setup_with_fixtures’
d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fix
tures.rb:575:in `setup’
1 tests, 0 assertions, 0 failures, 1 errors
I have not an idear. Please help me!!