Re: [rspec-users] RSpec Testing ActiveRecord config dependency.

2009-02-09 Thread James Byrne
James Byrne wrote: > It seems that I am not overriding the AR:BASE.default_timezone setting > since, as far as I can tell, the values stored are the same whatever > value I set the default_tz to. > Well, after a very frustrating afternoon I have finally uncovered what is going on. The proble

Re: [rspec-users] RSpec Testing ActiveRecord config dependency.

2009-02-09 Thread James Byrne
David Chelimsky wrote: > Now this violates a principle that you shouldn't stub things on the > object you're spec'ing, but the alternative is to play with global > values, which violates other principles. This is the simplest way IMO. > But if you're concerned about internals of AR changing, you c

Re: [rspec-users] RSpec Testing ActiveRecord config dependency.

2009-02-09 Thread David Chelimsky
On Mon, Feb 9, 2009 at 9:12 AM, James Byrne wrote: > I have the following library code: > >def normal_time_now > return DateTime.now.utc if default_timezone == :utc > return DateTime.now >end > > This is dependent upon a setting in config/environment.rb > > # Make Active Record

[rspec-users] RSpec Testing ActiveRecord config dependency.

2009-02-09 Thread James Byrne
I have the following library code: def normal_time_now return DateTime.now.utc if default_timezone == :utc return DateTime.now end This is dependent upon a setting in config/environment.rb # Make Active Record use UTC-base instead of local time config.active_record.defaul