[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to fix this error, help please!

OnRails Ruby

8/29/2007 7:00:00 AM

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/Fix...
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:in `read_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:in `new'
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:in `each'
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:in `each'
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:in `initialize'
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:in `create_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:in `create_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:in `create_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: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!!
--
Posted via http://www.ruby-....

5 Answers

Axel

8/29/2007 10:30:00 AM

0

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

OnRails Ruby

8/29/2007 2:48:00 PM

0

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"
--
Posted via http://www.ruby-....

Alex Young

8/29/2007 2:58:00 PM

0

OnRails Ruby wrote:
> 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"
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

OnRails Ruby

8/29/2007 3:26:00 PM

0

Alex Young wrote:
> OnRails Ruby 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!

--
Posted via http://www.ruby-....

Alex Young

8/29/2007 3:55:00 PM

0

OnRails Ruby wrote:
> Alex Young wrote:
>> OnRails Ruby 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!
>
http://groups.google.com/group/rubyon...

--
Alex