search for: first_valu

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

Did you mean: 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...
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
...pare byte padding macros against the expected bytes. test: reduce range of byte-padding macro tests. dix: replace a manual valuator check with valuator_get_mode(). dix: when comparing axis modes, compare the bits, not the bytes. dix: when converting to XI 1.x events, use the first_valuator's device mode dix: GetProximityEvents needs to check up to the last valuator dix: fix typo, set the second valuator with the y-axis data. dix: add a fixme about a corner-case that should probably be fixed. include: let BitIsOn() return a boolean value. dix: rem...