Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use begin/rescue instead of def/rescue.

  • Loading branch information...
commit a4b4feb2dc05826f8c60009fc634a2f11ac653ba 1 parent 9565ddd
@readeharris readeharris authored drapergeek committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/shoulda/matchers/independent/delegate_matcher.rb
View
10 lib/shoulda/matchers/independent/delegate_matcher.rb
@@ -20,10 +20,12 @@ module Independent # :nodoc:
# it { should delegate_method(:deliver_mail).to(:mailman).with_arguments('221B Baker St.', :hastily => true)
#
def delegate_method(delegating_method)
- require 'bourne'
- DelegateMatcher.new(delegating_method)
- rescue LoadError
- raise "To use Shoulda's #delegate_method matcher, please add `bourne` to your Gemfile."
+ begin
+ require 'bourne'
+ DelegateMatcher.new(delegating_method)
+ rescue LoadError
+ raise "To use Shoulda's #delegate_method matcher, please add `bourne` to your Gemfile."
+ end
end
class DelegateMatcher
Please sign in to comment.
Something went wrong with that request. Please try again.