en? }
end
Then:
block_yield(thing, :do_stuff).should == "value"
Mvh
Morten Møller Riis
On Mar 7, 2012, at 9:42 PM, David Chelimsky wrote:
> On Wed, Mar 7, 2012 at 2:32 PM, Matt Wynne wrote:
>>
>> On 7 Mar 2012, at 18:16, David Chelimsky wrote:
>>
>> O
How about this?
thing.do_stuff(&:to_s).should == expected
Best regards
Morten Møller Riis
On Mar 7, 2012, at 8:22 AM, Matt Wynne wrote:
> Hi all,
>
> I'm spec'ing a method that yields a value. Right now, I spec it like this:
>
> result = nil
>
This looks a little funny in my phone. But what happens if you do this?
...
options = Options.new(argv)
puts "argv[0]: #{argv[0]}"
puts "argv[1]: #{argv[1]}"
...
Best regards
Morten
Sent from my iPhone
On 15/02/2012, at 19.26, Serguei Cambour wrote:
> I just tried to integrate a simple test
You can use things like Timecop.
I prefer to just stub Time.now:
timestamp = Time.now.to_i
Time.stub(:now).returns(Time.at(timestamp))
Best regards
Morten Møller Riis
On Jan 26, 2012, at 4:44 PM, Yi Wen wrote:
> Say I do:
>
> ```ruby
> object.method 5.days.ago
> ```
>
d => @user.id,
:foo => "bar",
:custom => @encoded
})).and_yield(paypal_error)
Mvh
Morten Møller Riis
On Dec 9, 2011, at 8:02 AM, Patrick J. Collins wrote:
> Hi,
>
> So I am not really intere
FakeFS definitely looks like a nice solution!
I also like the argument about not tightly coupling the specs to File and
FileUtils.
Mvh
Morten Møller Riis
On Dec 5, 2011, at 6:21 PM, David Chelimsky wrote:
> On Mon, Dec 5, 2011 at 9:13 AM, Morten Møller Riis
> wrote:
>> Hi Matt
could be worked out, but for things like #rm_r I do
like just to mock them.
Please let me know if this is not best practice. I know one can "over-mock" a
spec suite, but I generally tend to mock things that are tested/spec'ed
themselves.
Mvh
Morten Møller Riis
On Dec 5, 2011, a
For the moment I have done this:
def Process.fork(&block)
block.call
end
So that Process.fork doesn't actually spawn a new process but just runs it in
the current one.
But any better suggestions are welcome :)
Mvh
Morten Møller Riis
On Dec 5, 2011, at 1:04 PM, Morten Møller R
od_R).with(0755, "#{@domain.directory}/*")
I guess that is because it is passed in the block and fired off in a seperate
process (Process.fork).
Mvh
Morten Møller Riis
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.o