On Jun 15, 8:23 am, nico Itkin <[email protected]>
wrote:
> Frederick Cheung wrote:
> > On Jun 14, 11:23 pm, nico Itkin <[email protected]>
> > wrote:
> >> Frederick Cheung wrote:
>
> >> ... all the instance of type StatusAction become constants called
> >> StatusAction::THE_RECORD_NAME_FIELD
>
> >> well the strangest is that is contant_cache seems not to be correctly
> >> run from rake...
>
> > So what exactly happens when you run rake ?
>
> > Fred
>
> When I run ruby unit/status_test.rb : everything is fine, constants are
> all present
>
> When I run rake test:units : no constant is set, as if constant_cache
> hasn't been run
>
Did you stick a breakpoint in constant_cache ? I rather suspect that
it is running but that the particular sequence of actions that takes
place means that it happens before fixtures have been loaded.
When you run rake the test database is recreated from scratch and so
starts of empty (and then fixtures are loaded).
When you run a single test file then the test database isn't recreated
and so the fixtures are already there.
Your setup method probably runs after fixtures have been loaded, but
all it does is call require and that file was already required earlier
on when rails loaded your initializers so those requires may well be
no-ops.
Fred
> ... so my trouble
>
> Thanks, Itkin
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---