Awesome! Thanks, Scott and David. That was some intense turn-around.
-Adam
On Tue, Jul 14, 2009 at 9:15 PM, David Chelimsky wrote:
> On Mon, Jul 13, 2009 at 1:17 PM, Scott Taylor
> wrote:
> >
> > On Jul 13, 2009, at 2:15 PM, Scott Taylor wrote:
> >
> >>
> >> On Jul 13, 2009, at 2:12 PM, David C
On Mon, Jul 13, 2009 at 1:17 PM, Scott Taylor wrote:
>
> On Jul 13, 2009, at 2:15 PM, Scott Taylor wrote:
>
>>
>> On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote:
>>
>>> On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylor
>>> wrote:
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
>
>From: Adam Anderson
>
>Would using this kind of technique require me to use that intention-revealing
>method to be used in place of Time.now everywhere in the app? That is what it
>seems like to me and if that's the case then I couldn't see myself doing a
>Find/Replace across the entire a
Awesome! All of these are solid ways to go, Scott. There is currently an
"at_exactly" method in the app's spec_helper so replacing that with
time_travel seems like a good idea. Thanks for your help.
-Adam
On Mon, Jul 13, 2009 at 11:04 AM, Scott Taylor wrote:
>
> On Jul 13, 2009, at 1:46 PM, Sco
On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylor wrote:
>
> On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
>
> On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
>
> Thanks for the reply, Scott.
>
> What you describe is what is currently being done.
>
> now = Time.now
> Time.stub!(:now).and_return(fo
On 13 Jul 2009, at 19:17, Scott Taylor wrote:
On Jul 13, 2009, at 2:15 PM, Scott Taylor wrote:
On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote:
On Mon, Jul 13, 2009 at 1:04 PM, Scott
Taylor wrote:
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
On Jul 13, 2009, at 1:32 PM, Adam An
On 13 Jul 2009, at 19:12, David Chelimsky wrote:
On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylor
wrote:
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
Thanks for the reply, Scott.
What you describe is what is currently being done.
now = T
On Jul 13, 2009, at 2:15 PM, Scott Taylor wrote:
On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote:
On Mon, Jul 13, 2009 at 1:04 PM, Scott
Taylor wrote:
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
Thanks for the reply, Scott.
What
On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote:
On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylor
wrote:
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
Thanks for the reply, Scott.
What you describe is what is currently being done.
now
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
Thanks for the reply, Scott.
What you describe is what is currently being done.
now = Time.now
Time.stub!(:now).and_return(foo_time)
do_stuff
Time.stub!(:now).and_return(now)
However, this i
On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
Thanks for the reply, Scott.
What you describe is what is currently being done.
now = Time.now
Time.stub!(:now).and_return(foo_time)
do_stuff
Time.stub!(:now).and_return(now)
However, this is not returning the actual time it is only returning
Thanks for the reply, Scott.
What you describe is what is currently being done.
now = Time.now
Time.stub!(:now).and_return(foo_time)
do_stuff
Time.stub!(:now).and_return(now)
However, this is not returning the actual time it is only returning the time
set on the first line. I need Time.now to re
Would using this kind of technique require me to use that
intention-revealing method to be used in place of Time.now everywhere in the
app? That is what it seems like to me and if that's the case then I couldn't
see myself doing a Find/Replace across the entire app on Time.now. If I am
misunderstan
Adam,
What I usually do is extract out the original Time.now call to method
somewhere (with an intention revealing name) and stub out the method
instead of #now itself.
-
BJ Clark
On Jul 13, 2009, at 9:45 AM, Adam Anderson wrote:
So that is what is happening now. Time.now is being st
On Jul 13, 2009, at 12:09 PM, Adam Anderson wrote:
I can't seem to find a good way to do this. If I stub out Time.now
in one of my specs but need to return it to its original
functionality then can I remove the stub?
So I'd like to say something like:
Time.stub!(:now).and_return(foo_time)
So that is what is happening now. Time.now is being stubbed but that will
last for the life of the spec, but I only need it to create some test data
and I don't want it to affect other areas of the app after that test data
has been created. Currently Time.now is being used somewhere to create a
gui
Can you just stub it before the example in question, either in it or in a
before block?
2009/7/13 Adam Anderson
> I can't seem to find a good way to do this. If I stub out Time.now in one
> of my specs but need to return it to its original functionality then can I
> remove the stub?
>
> So I'd l
I can't seem to find a good way to do this. If I stub out Time.now in one of
my specs but need to return it to its original functionality then can I
remove the stub?
So I'd like to say something like:
Time.stub!(:now).and_return(foo_time)
Time.now # => foo_time
Time.unstub!(:now)
Time.now # => wha
18 matches
Mail list logo