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 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

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 ruby Unit/test
    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!!

Hello,

line: “Errno::ENOENT: No such file or directory - The ruby Unit/test”
says, that “The ruby Unit/test” is expected to be a filename or a
directory name, but is not.

  • Axel

Axel wrote:

Hello,

line: “Errno::ENOENT: No such file or directory - The ruby Unit/test”
says, that “The ruby Unit/test” is expected to be a filename or a
directory name, but is not.

  • Axel

Thank you for your answer. I see this. but “The ruby Unit/test” is just
a value of “title” column. I want to know how to fix the problem.
Otherwise, I useed other date, like “The word help”, display the similar
error.

Errno::ENOENT: No such file or directory - The word help"

OnRails R. wrote:

a value of “title” column. I want to know how to fix the problem.
Otherwise, I useed other date, like “The word help”, display the similar
error.

Errno::ENOENT: No such file or directory - The word help"
The point is that ActiveRecord thinks that data should be a filename,
for some reason. From where the error’s heppening, I’d guess it’s doing
something automagical with fixture loading. You’re best bet is to ask
for more info on the Rails list.

Alex Y. wrote:

OnRails R. wrote:

a value of “title” column. I want to know how to fix the problem.
Otherwise, I useed other date, like “The word help”, display the similar
error.

Errno::ENOENT: No such file or directory - The word help"
The point is that ActiveRecord thinks that data should be a filename,
for some reason. From where the error’s heppening, I’d guess it’s doing
something automagical with fixture loading. You’re best bet is to ask
for more info on the Rails list.

Thank you. I think that reason is caused by fixture. where can I get
more info about that. thanks!

OnRails R. wrote:

for more info on the Rails list.

Thank you. I think that reason is caused by fixture. where can I get
more info about that. thanks!

http://groups.google.com/group/rubyonrails-talk

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