HashWithIndifferentAccess in testing

Hi,

Do you put this line APP_TEXT = ...
at the end or beginning of the environment.rb file?

First I put it right below
require File.join(File.dirname(__FILE__), 'boot')
and then I tried moving it to
Rails::Initializer.run do |config|
  APP_TEXT =
(HashWithIndifferentAccess).new(YAML::load(File.open("#{RAILS_ROOT}/config/strings.yml")))
however this does not work.

reHa wrote:

I ussually add my things after the initializer - mybe try this way

Rails::Initializer.run do |config|
  #standard stuff
end

#my stuff
APP_TEXT = ....

The reason why this is a good thing is that it means the code runs
after Rails has been loaded. Given that HashWithIndifferentAccess is
part of rails this is a good thing !

Fred
(PS: config/initializers)

Thanks! that worked perfectly,
I still don't really understand why the error didn't come up during
development and only during the unit testing. But thanks a lot!

Frederick Cheung wrote:

No problem - actually it is interisting question why it worked on the
development environment but I don't know the answer :wink: