Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ask if the context supports the missing method

  • Loading branch information...
commit 73262737fd1bdd6552da8a4327d3ff32f7e78439 1 parent e9a9e46
@dchelimsky dchelimsky authored
View
4 lib/rspec/matchers/matcher.rb
@@ -90,9 +90,9 @@ def chain(method, &block)
private
def method_missing(name, *args, &block)
- begin
+ if $matcher_execution_context.respond_to?(name)
$matcher_execution_context.send name, *args, &block
- rescue NoMethodError
+ else
super(name, *args, &block)
end
end
View
2  spec/rspec/matchers/matcher_spec.rb
@@ -308,7 +308,7 @@ def a_method_in_the_example
expect do
running_example.should __raise_no_method_error
- end.to raise_error(NoMethodError, /Rspec::Matchers::Matcher/)
+ end.to raise_error(/Rspec::Matchers::Matcher/)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.