From 47d32e5dc28e34c3024008be91d22523264d0da5 Mon Sep 17 00:00:00 2001 From: Erik Ogan and Thomas Shafer Date: Thu, 2 Feb 2012 18:31:37 -0800 Subject: [PATCH] Added failing test for respond_to? behavior changing on calls to method_missing --- .../injections/method_missing_injection_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/rr/injections/method_missing_injection_spec.rb diff --git a/spec/rr/injections/method_missing_injection_spec.rb b/spec/rr/injections/method_missing_injection_spec.rb new file mode 100644 index 00000000..b34edfaa --- /dev/null +++ b/spec/rr/injections/method_missing_injection_spec.rb @@ -0,0 +1,17 @@ +require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper") + + +describe RR::Injections::MethodMissingInjection do + + context "#bind_method" do + it 'should not change the behavior of respond_to?' do + o = Object.new + stub(o).some_method { true } + o.respond_to?(:another_method).should be_false + lambda { o.another_method }.should raise_error(NoMethodError) + o.respond_to?(:another_method).should be_false + end + + end + +end