How to fix this error, help please!

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 word help”,@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 word help

line command:
ruby test\unit\work_test.rb

Result:

Loaded suite test/unit/work_test
Started
E
Finished in 0.11 seconds.

  1. Error:
    test_create(WorkTest):
    Errno::ENOENT: No such file or directory - The word help
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:432:in readlines' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:432:inread_fixture_file’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:386:in initialize' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:326:innew’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:326:in read_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:321:ineach’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:321:in read_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:320:ineach’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:320:in read_fixture_files' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:281:ininitialize’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:251:in new' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:251:increate_fixtures’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:250:in map' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:250:increate_fixtures’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/bas
    e.rb:867:in silence' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:248:increate_fixtures’
    d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
    active_record/fix
    tures.rb:593:in load_fixtures' d:/ror/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/fix tures.rb:538:insetup_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!!

OnRails wrote:

works.yml:

Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

Create_ONE:
id: 1
composer_id: 3
title: The word help

Indent the lines after Create_ONE: with spaces like:

Create_ONE:
id: 1
composer_id: 3
title: The word help


Michael W.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs