Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup 11/29/12: Time.now, more like Time.at(2011)

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/

Comments
  1. Doc Ritezel says:

    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

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *