[rspec-users] "lambda Should Change" Behavior Failing When Checking Time

Carlos Rodriguez carlos at eddorre.com
Sun Nov 8 13:10:28 EST 2009


Thanks to everyone that responded to my question.

Here is what I ended up doing to make the spec pass:

time_now = Time.now
Time.stub!(:now).and_return(time_now)
lambda { @post.publish! }.should change(@post,
:published_at).from(nil).to(time_now)

Carlos


More information about the rspec-users mailing list