Helps
mock object nil when it shouldn’t be
(rdb:1) @registration
RSpec::Mocks::Mock:0x3fda7eabfd68 @name=”mocked registration”
(rdb:1) @registration.present?
false
(rdb:1) @registration.nil?
false
- mock objects don’t always define nil? or present?
Interestings
David Chelimsky handing off rspec
David Chelmisky is stepping down as the RSpec lead after 6+ years. http://blog.davidchelimsky.net/2012/11/28/myron-marston-and-andy-lindeman-are-rspecs-new-project-leads/
Dmitriy had a help this morning relating to this error coming from a Resque job:
PG::Error: ERROR: prepared statement “a1″ already exists (ActiveRecord::StatementInvalid):
SELECT COUNT(*)
FROM pg_class c
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind in (‘v’,'r’)
AND c.relname = $1
AND n.nspname = ANY (current_schemas(false))
Turns out this is actually a point of discussion on the Github page for Rails: [https://github.com/rails/rails/pull/5872](https://github.com/rails/rails/pull/5872)
We found that, just as in the comments for this issue, adding the following to our Rakefile was the solution:
task “resque:setup” => :environment do
Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
end
November 29, 2012 at 10:54 am