Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove deprecation warning

  • Loading branch information...
commit a8dec7501cbbff91d7908bb57f09e74e799920cb 1 parent 17b4d27
@dchelimsky dchelimsky authored
View
18 lib/rspec/expectations/fail_with.rb
@@ -13,22 +13,6 @@ def fail_with(message, expected=nil, target=nil) # :nodoc:
raise ArgumentError, "Failure message is nil. Does your matcher define the " +
"appropriate failure_message_for_* method to return a string?"
end
- if (Array === message) & (message.length == 3)
- ::Rspec::Core.warn(<<-NOTICE
-
-*****************************************************************
-DEPRECATION WARNING: you are using deprecated behaviour that will
-be removed from a future version of RSpec.
-
-* Support for matchers that return arrays from failure message
-methods is deprecated.
-* Instead, the matcher should return a string, and expose methods
-for the expected() and actual() values.
-*****************************************************************
-NOTICE
- )
- message, expected, target = message[0], message[1], message[2]
- end
unless (differ.nil? || expected.nil? || target.nil?)
if expected.is_a?(String)
message << "\nDiff:" << self.differ.diff_as_string(target.to_s, expected)
@@ -40,4 +24,4 @@ def fail_with(message, expected=nil, target=nil) # :nodoc:
end
end
end
-end
+end
View
7 spec/rspec/expectations/fail_with_spec.rb
@@ -21,13 +21,6 @@
before(:each) do
Rspec::Core.stub!(:warn)
end
-
- it "is deprecated" do
- Rspec::Core.should_receive(:warn)
- lambda {
- Rspec::Expectations.fail_with ["message", "expected", "actual"]
- }.should raise_error
- end
end
describe Rspec::Expectations, "#fail_with with diff" do
Please sign in to comment.
Something went wrong with that request. Please try again.