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

2009-11-08 Thread Rodrigo Rosenfeld Rosas
Carlos Rodriguez escreveu: 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) I have thought on t

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

2009-11-08 Thread Carlos Rodriguez
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 ___

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

2009-11-08 Thread Ashley Moran
On Nov 08, 2009, at 10:39 am, Rodrigo Rosenfeld Rosas wrote: @post.published_at.should be_nil @post.publish! (Time.now - @post.published_at).should have_at_most(1).second FWIW, this is what I do too, although I normally use "should <" or "be_close", but the idea is the same. You only need

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

2009-11-08 Thread Rodrigo Rosenfeld Rosas
David Chelimsky escreveu: On Sat, Nov 7, 2009 at 6:18 PM, Carlos Rodriguez > wrote: Hello, I'm having a problem with RSpec when using the "lambda should change behavior". This is happening in a Rails 2.3.4 app and I'm running the following in my t

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

2009-11-07 Thread David Chelimsky
On Sat, Nov 7, 2009 at 6:18 PM, Carlos Rodriguez wrote: > Hello, > > I'm having a problem with RSpec when using the "lambda should change > behavior". > > This is happening in a Rails 2.3.4 app and I'm running the following > in my test environment: > > 'cucumber', :version => '0.4.2' > 'faker',

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

2009-11-07 Thread Carlos Rodriguez
Hello, I'm having a problem with RSpec when using the "lambda should change behavior". This is happening in a Rails 2.3.4 app and I'm running the following in my test environment: 'cucumber', :version => '0.4.2' 'faker', :version => '0.3.1' 'notahat-machinist', :lib => 'machinist', :version => '