Re: Vanilla Rails 2.1 and Unit Test Error

redconfetti
Sun, 15 Jun 2008 17:23:20 -0000

I''m learning from this book to currently and got snagged on the test
chapter because of this same error -
http://www.pragprog.com/titles/ndphpr/rails-for-php-developers

It has me run a test directly like ''ruby test/unit/meeting_test.rb . I
just changed the require at the top from:

require ''test_helper''

to:

require ''test/test_helper''

I don''t know if this will help you when running from rake though, but
it worked for me. Perhaps this is a mistake with 2.1.0. I''m
don''t
know. I''m a noob.


On Jun 3, 6:52 pm, "Derek P."
<de...-88kYAtoe8eYTx9n+QjaLhg@public.gmane.org>
wrote:
> I did a basic rails 2.1 command and made a basic model and ran the
> unit tests with rake, I get this error:
>
> LoadError: no such file to load — test_helper
>
> I went back and compared my old unit tests from other projects to the
> one that was generated, this is what I found:
>
> RAILS 2.1:
> require ''test_helper''
>
> RAILS 2.0.2:
> require File.dirname(__FILE__) + ''/../test_helper''
>
> Now, if I copy/paste my old rails 2.0.2 require statement, it works
> perfectly. Did this get overlooked?

--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---