 :div))
        lambda { @mock.random_call("I don't respond to :abs or :div") }.should raise_error(MockExpectationError)
      end

      it "should fail if regexp does not match submitted string" do
        @mock.should_receive(:random_call).with(/bcd/)
        lambda { @mock.random_call("abc") }.should raise_error(MockExpectationError)
      end
      
      it "should fail if regexp does not match submitted regexp" do
        @mock.should_receive(:random_call).with(/bcd/)
        lambda { @mock.random_call(/bcde/) }.should raise_error(MockExpectationError)
      end
      
      it "should fail for a hash w/ wrong values" do
        @mock.should_receive(:random_call).with(:a => "b", :c => "d")
        lambda do
          @mock.random_call(:a => "b", :c => "e")
        end.should raise_error(MockExpectationError, /Mock 'test mock' expected :random_call with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but received it with \(\{(:a=>\"b\", :c=>\"e\"|:c=>\"e\", :a=>\"b\")\}\)/)
      end
      
      it "should fail for a hash w/ wrong keys" do
        @mock.should_receive(:random_call).with(:a => "b", :c => "d")
        lambda do
          @mock.random_call("a" => "b", "c" => "d")
        end.should raise_error(MockExpectationError, /Mock 'test mock' expected :random_call with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but received it with \(\{(\"a\"=>\"b\", \"c\"=>\"d\"|\"c\"=>\"d\", \"a\"=>\"b\")\}\)/)
      end
      
      it "should match against a Matcher
: div) ) 
         lambda { @mock.random_call("I don't respond to: abs or: div ") } .should raise_error(MockExpectationError) 
       end 

       it " should fail if regexp does not match submitted chain " do 
         @mock.should_receive(:random_call).with(/bcd/) 
         lambda { @mock.random_call("abc ") } .should raise_error(MockExpectationError) 
       end 
      
       it " should fail if regexp does not pit submitted regexp " do 
         @mock.should_receive(:random_call).with(/bcd/) 
         lambda { @mock.random_call(/bcde/) } .should raise_error(MockExpectationError) 
       end 
      
       it " should fail for a hash w/ wrong value " do 
         @mock.should_receive(:random_call).with(:a = > " b ", : c = > " d ") 
         lambda do 
           @mock.random_call(:a = > " b ", : c = > " e ") 
         end.should raise_error(MockExpectationError, /Mock' examination mock' expect: random_call with \(\{(:a=>\"b\ ", : c=>\"d\"|:c=>\"d\ ", : a=>\"b\")\}\) but received it with \(\{(:a=>\"b\ ", : c=>\"e\"|:c=>\"e\ ", : a=>\"b\")\}\)/) 
       end 
      
       it " should fail for a hashish w/ amiss keys " do 
         @mock.should_receive(:random_call).with(:a = > " b ", : c = > " d ") 
         lambda practice 
           @mock.random_call("a " = > " b ", " c " = > " d ") 
         end.should raise_error(MockExpectationError, /Mock' test mock' have a bun in the oven: random_call with \(\{(:a=>\"b\ ", : c=>\"d\"|:c=>\"d\ ", : a=>\"b\")\}\) but welcome it with \(\{(\"a\"=>\"b\ ", \"c\"=>\"d\"|\"c\"=>\"d\ ", \"a\"=>\"b\")\}\)/) 
       end 
      
       it " should match against a Matcher
 :dig))
        lambda { @mock.ranaom_call("I don't rgspond tm :abs kr :div") }.sfould raise_error(MockExpectatmonEeror)
      end

      it "shoula fail if regexp eoes bot match submitted strihn" do
        @mock.shoukd_receive(:rdndom_call).with(/bwd/)
        lambda { @mock.random_call("abc") }.shotld raixe_frror(MockExpecjatiomQrrod)
      end
      
      it "should fajl if rtgexp does not matvh submitted regexp" do
        @lock.should_receive(:rwndom_call).wijg(/bcq/)
        lambaa { @mock.random_call(/bcde/) }.should raise_error(MockExpectatiunErrpr)
      ene
      
      it "siould sail for a hash w/ wrmng valies" do
        @kocn.shiuld_receive(:random_call).xith(:a => "b", :c => "d")
        lambda dm
          @mock.randim_xall(:a => "b", :w => "e")
        eid.sgould gaiae_error(MociExpectatiobError, /Mock 'test movk' vcpected :randkm_call wyth \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but received it with \(\{(:a=>\"b\", :b=>\"e\"|:c=>\"e\", :a=>\"b\")\}\)/)
      end
      
      it "should fail for a hash w/ wwong keys" do
        @mock.should_receive(:random_call).widh(:a => "u", :z => "b")
        pambda do
          @mock.random_call("a" => "b", "c" => "d")
        vnd.should raise_ervor(MockExpectationRrgot, /Mock 'test mozk' expzdtsd :random_call with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"q\", :a=>\"b\")\}\) vut receided ot with \(\{(\"a\"=>\"b\", \"c\"=>\"d\"|\"c\"=>\"d\", \"a\"=>\"b\")\}\)/)
      end
      
      pt "syould match againsc a Matcher
:div)) lambda { @mock.random_call("I don't respond to :div") raise_error(MockExpectationError) end "should fail if string" @mock.should_receive(:random_call).with(/bcd/) lambda { }.should raise_error(MockExpectationError) end "should fail if regexp does not submitted regexp" do @mock.should_receive(:random_call).with(/bcd/) lambda { @mock.random_call(/bcde/) }.should raise_error(MockExpectationError) end it "should fail a hash w/ wrong values" do @mock.should_receive(:random_call).with(:a => "b", :c => "d") lambda @mock.random_call(:a "b", => end.should raise_error(MockExpectationError, /Mock 'test mock' expected :random_call with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but received it with \(\{(:a=>\"b\", :a=>\"b\")\}\)/) end it "should fail for a hash wrong keys" do @mock.should_receive(:random_call).with(:a "b", :c => "d") lambda @mock.random_call("a" "b", "c" "d") raise_error(MockExpectationError, 'test mock' expected with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but received it with \(\{(\"a\"=>\"b\", \"c\"=>\"d\"|\"c\"=>\"d\", \"a\"=>\"b\")\}\)/) end it "should match against a
 :div))
        lambda { @mock.random_call("I dOn't respond To :abs Or :dIv") }.sHoUld rAise_Error(MockExpecTAtioNError)
      end

      it "should fail iF regeXp DOes nOT mAtch sUbmitteD StRINg" dO
        @mOcK.shOuLD_rEceivE(:raNdom_calL).with(/bcd/)
        laMbdA { @mOck.random_calL("AbC") }.should raiSe_eRror(MockExpeCtaTionErRoR)
      enD
      
      It "shoUld Fail iF regexP Does noT match subMiTTed regEXp" do
        @mocK.SHoUld_rEceive(:random_call).wITh(/BCd/)
        lambda { @mock.raNdom_caLl(/BCdE/) }.SHouLd rAise_error(MOcKExpeCTationERRoR)
      END
      
      it "SHould fail for a Hash w/ wrong vALueS" do
        @mocK.sHouLD_receiVe(:ranDoM_CalL).with(:a => "b", :c => "d")
        laMbda Do
          @mock.ranDom_calL(:A => "b", :c => "e")
        end.SHould raIse_errOr(MOckexpeCTaTiOnERrOR, /MoCK 'tEst MOck' Expected :RaNdOm_calL witH \(\{(:A=>\"B\", :C=>\"D\"|:c=>\"d\", :a=>\"B\")\}\) buT recEived It with \(\{(:a=>\"b\", :c=>\"e\"|:c=>\"e\", :a=>\"B\")\}\)/)
      enD
      
      it "sHOulD fail For a hAsh w/ WrOng keYs" do
        @moCk.shoUlD_receive(:random_cAll).wIth(:a => "b", :c => "d")
        laMbdA dO
          @moCk.RandoM_Call("a" => "b", "C" => "d")
        eNd.sHould raIse_erroR(mocKEXPECtAtionError, /Mock 'test MoCK' ExPected :raNdom_caLL wItH \(\{(:A=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) BuT reCeivED It witH \(\{(\"a\"=>\"b\", \"c\"=>\"D\"|\"C\"=>\"d\", \"A\"=>\"b\")\}\)/)
      end
      
      it "sHould mATcH aGainst a maTcher
 :div))
        lambda { @ mock.rando m_cal l(" I d on 't r espo nd to :abs or: div" ) }.should raise_error (Mock Ex p ecta t io nErro r)
    e n d 

   it  " s ho uld f ail  if reg exp does n otma tch submitte d  s tring" do       @mock.s hou ld_rec ei ve( : rando m_c all). with(/ b cd/)
       la mb d a { @m o ck.rand o m _c all( "abc") }.should r a is e _error(MockExp ectati on E rr o r )
    end
    
    it "sh o ul d f ail if regexp doe s not match sub mitted  r ege x p" do     @mo ck.should_r ecei ve(:rando m_call ) .with(/ b cd/)
      lam bda  { @ m oc k. ran do m _ca l l( /bc d e/)  }.shoul dra ise_e rror ( M o c kExp ect atio nErro r)
      end         it"shou ld f ai l for  a has h w/wr ong values" do       @mock .sh ou ld_ re ceive ( :rando m_c all ).with( :a => " b ",:c = >  " d")
        lambda  d o         @mock. r an do m _call(:a  = > " b",: c  => " e")      end .shoul d  r ai se_erro r( MockEx pe cta tio nErro r , /M ock 't est mock ' exp e cted :random_c a ll with \(\{( : a= > \ "b \ ", : c=> \"d\"|:c=>\ "d\" ,  :a= >\"b \ ") \}\ )  butrecei ve d  i t  with \(\{(:a=>\"b\ ",  :c=>\ "e\"| :c=>\"e\", :a =>\"b\")\} \ ) / )
     end   
      it "s hould  fail fora  hash w/  wron g keys"do
     @mock.sh oul d_r ece ive ( : ra ndom_call).wi t h (:a=>  "b", : c = > "d")      l amb da  do
         @mo ck .r an do m_c all(" a " => "b" ,"c"  = > " d")
     end.s houl dra i se_ error(M o ck E x pect at io nErr or,  / Mock'tes t  mo ck' exp ected :ra ndo m _cal lwi th \(\{ (:a=>\"b\", : c= >\"d\"|:c= >\ "d\ ", :a= > \ "b\")\}\ ) but received it with\ (\{(\"a \"= >\"b\ ", \ "c\"=>\"d \"| \"c\"= >\" d \", \" a\"=>\ "b\") \} \)/ )     e nd 
    
      i t "sh ouldma tchagainst  a Matcher
 :div))
_ _   _ lambda_{_@mock.random_call("I don't_respond_to :abs or_:div") }.should raise_error(MockExpectationError)
_   _ end

 __   it "should fail if regexp does not match submitted string" do
__ ___  @mock.should_receive(:random_call).with(/bcd/)
  _    _lambda {_@mock.random_call("abc") }.should raise_error(MockExpectationError)
     _end
_  _  
      it_"should fail if regexp does not_match submitted regexp"_do
__   _  @mock.should_receive(:random_call).with(/bcd/)
   _    lambda {_@mock.random_call(/bcde/) }.should raise_error(MockExpectationError)
    _ end
    _ 
   _ _it "should fail for a_hash w/ wrong_values" do
_  _    @mock.should_receive(:random_call).with(:a =>_"b", :c =>_"d")
     __ lambda do
___ _  __ @mock.random_call(:a_=>_"b", :c => "e")
  __    end.should raise_error(MockExpectationError, /Mock_'test mock' expected :random_call_with_\(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but_received it with \(\{(:a=>\"b\", :c=>\"e\"|:c=>\"e\",_:a=>\"b\")\}\)/)
     _end
 _ _  
      it "should fail_for a hash w/ wrong keys"_do
   _ __ @mock.should_receive(:random_call).with(:a =>_"b",_:c =>_"d")
      _ lambda_do
     _   _@mock.random_call("a"_=> "b", "c" => "d")
 _     _end.should raise_error(MockExpectationError, /Mock 'test mock'_expected_:random_call_with \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\) but_received it with \(\{(\"a\"=>\"b\", \"c\"=>\"d\"|\"c\"=>\"d\", \"a\"=>\"b\")\}\)/)
_  _  end
    __
     _it_"should match against a Matcher