search for: first_value

Displaying 5 results from an estimated 5 matches for "first_value".

2007 Apr 30
4
Mocking with Calculated Results
...a message'']) @setting = mock_model Setting do |m| m.stub!(:save).and_return(true) m.stub!(:destroy) m.stub!(:errors).and_return(@countable) m.stub!(:setting_name).and_return(''first_name'') m.stub!(:setting_value).and_return(''first_value'') m.stub!(:setting_type).and_return(''first_type'') end Setting.should_receive(:find).any_number_of_times.and_return do |a| case a when :all then [@setting, @setting] when /\d+/ then @setting else nil end...
2008 Jun 05
1
Using and_yield to pass multiple or no iterations
...thing" do @egg.stub!( each_row ).and_yield( :value ) @egg.do_thing.should be_true end </SPEC> Secondly, is this the best (correct) way to pass multiple values to iterate over? <SPEC> it "should be doing something else, too" @egg.stub!( :each_row ). and_yield( :first_value ). and_yield( :second_value ). and_yield( :third_value ) @egg.do_thing.should be_true end </SPEC> As you can see, my understanding of and_yield() is *very* imperfect, so any & all pointers are very gratefully received. Cheers, Doug. -- Posted via http://www.ruby-forum.com/.
2007 Mar 03
11
Beyond multiple return values
First off, I love mocha and have been using it all over the place ever since I found it a few months ago. So I noticed the other day rather belatedly that mocha-0.4.0 had been released and that we can now do the object.stubs(:method).returns (:first_value, :second_value). Much neater than fiddling with lambdas everytime this sort of behaviour is needed But can we go further ? I was writing a test today and I wanted the first call to a method to raise an exception and the next call to return a value (I was testing a method on an ActiveRecord o...
2007 Apr 28
7
[ rspec-Patches-9605 ] Patch for ER 9472, shared behaviour
Hi all - I''ve applied (to trunk) Bob Cotton''s patch which supports shared behaviours (link to tracker below). I''m still toying w/ names, so please be aware that until this is released w/ 0.9 it should be considered experimental and there will NOT be translation support for it. It will definitely be included in some form - just the names (specifically
2010 Dec 07
1
[ANNOUNCE] xorg-server 1.9.99.901
Ok, I think we've done enough damage for one release. Thanks everyone for pulling a long weekend to get changes prepared and reviewed. We're still missing the threaded input stuff, but that needs more review and I think we wore Tiago out this time around. If someone wants to propose merging it after the freeze, I think we should consider doing it. Note that this tarball depends on