spec/proxy_spec.rb in caricature-0.1.2 vs spec/proxy_spec.rb in caricature-0.2.0

- old
+ new

@@ -7,23 +7,27 @@ @recorder = Caricature::MethodCallRecorder.new @proxy = Caricature::RecordingProxy.new(@subj, @recorder) end it "should forward existing methods" do - @proxy.name.should.equal @subj.name + @proxy.___super___.name.should.equal @subj.name end it "should call to_s on the proxied object" do - @proxy.to_s.should.equal @subj.to_s + @proxy.___super___.to_s.should.equal @subj.to_s end describe "when invoking a method" do before do @proxy.name end + it "should return nil" do + @proxy.name.should.be.nil + end + it "should record a call" do @recorder.size.should.equal 1 end it "should record the correct call" do @@ -47,20 +51,24 @@ @proxy = Caricature::RecordingClrProxy.new(@samurai, @recorder) end it "should create a proxy" do - @proxy.name.should.equal @samurai.name - @proxy.id.should.equal 0 + @proxy.___super___.name.should.equal @samurai.name + @proxy.___super___.id.should.equal 0 end describe "when invoking a method" do before do @proxy.name end + it "should return nil" do + @proxy.name.should.be.nil + end + it "should record a call" do @recorder.size.should.equal 1 end it "should record the correct call" do @@ -80,11 +88,11 @@ @recorder = Caricature::MethodCallRecorder.new @proxy = Caricature::RecordingClrProxy.new(ClrModels::Ninja, @recorder) end it "should create a proxy" do - @proxy.___subject___.class.should.equal ClrModels::Ninja - @proxy.id.should.equal 0 + @proxy.___super___.class.should.equal ClrModels::Ninja + @proxy.___super___.id.should.equal 0 end describe "when invoking a method" do \ No newline at end of file