Permalink
Browse files

Added failing test for respond_to? behavior changing on calls to meth…

…od_missing
  • Loading branch information...
1 parent 927315b commit 47d32e5dc28e34c3024008be91d22523264d0da5 Erik Ogan and Thomas Shafer committed with erikogan Feb 3, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 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

0 comments on commit 47d32e5

Please sign in to comment.