diff --git a/lib/shoulda/matchers/independent/delegate_method_matcher.rb b/lib/shoulda/matchers/independent/delegate_method_matcher.rb index 5948188ec..d7b88dc86 100644 --- a/lib/shoulda/matchers/independent/delegate_method_matcher.rb +++ b/lib/shoulda/matchers/independent/delegate_method_matcher.rb @@ -400,7 +400,7 @@ def subject_handles_nil_delegate_object? false rescue NoMethodError => e if e.message =~ - /undefined method `#{delegate_method}' for nil:NilClass/ + /undefined method `#{delegate_method}' for nil/ false else raise e