spec/method_call_spec.rb in casualjim-caricature-0.3.1 vs spec/method_call_spec.rb in casualjim-caricature-0.5.0

- old
+ new

@@ -11,17 +11,17 @@ before do @recorder.record_call :my_method end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -54,17 +54,17 @@ @block_content end end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -94,21 +94,21 @@ end describe "when recording a call 1 argument" do before do - @recorder.record_call :my_method, 1 + @recorder.record_call :my_method, :instance, 1 end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -138,21 +138,21 @@ end describe "when recording a call 2 arguments" do before do - @recorder.record_call :my_method, 1, 2 + @recorder.record_call :my_method, :instance, 1, 2 end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -187,17 +187,17 @@ @recorder.record_call :my_method @recorder.record_call :my_method end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -224,21 +224,21 @@ describe "when recording 2 calls with different arguments" do before do @recorder.record_call :my_method - @recorder.record_call :my_method, 1, 3, 4 + @recorder.record_call :my_method, :instance, 1, 3, 4 end it "should have 1 method call" do - @recorder.method_calls.size.should.equal 1 + @recorder.method_calls[:instance].size.should.equal 1 end describe "recorded call" do before do - @mc = @recorder.method_calls[:my_method] + @mc = @recorder.method_calls[:instance][:my_method] end it "should have a method call collected" do @mc.should.not.equal nil end @@ -265,31 +265,31 @@ describe "when asked if a certain method was called" do before do @recorder.record_call :my_method - @recorder.record_call :my_method, 1, 3, 4 + @recorder.record_call :my_method, :instance, 1, 3, 4 end it "should confirm when we don't care about the arguments" do - @recorder.was_called?(:my_method, :any).should.be.true? + @recorder.was_called?(:my_method, :instance, :any).should.be.true? end it "should confirm when there are no argument variations" do @recorder.record_call :another_method - @recorder.was_called?(:another_method, :any).should.be.true? + @recorder.was_called?(:another_method, :instance, :any).should.be.true? end it "should be negative when we provide the wrong arguments" do - @recorder.was_called?(:my_method, 1, 2, 5).should.be.false? + @recorder.was_called?(:my_method, :instance, 1, 2, 5).should.be.false? end it "should be positive when we provide the correct arguments" do - @recorder.was_called?(:my_method, 1, 3, 4).should.be.true? + @recorder.was_called?(:my_method, :instance, 1, 3, 4).should.be.true? end it "should be positive when we provide no arguments and a call had been recorded without arguments" do - @recorder.was_called?(:my_method).should.be.true? + @recorder.was_called?(:my_method, :instance).should.be.true? end end end \ No newline at end of file