lib/rspec/expectations/fail_with.rb in rspec-expectations-2.0.0.a2 vs lib/rspec/expectations/fail_with.rb in rspec-expectations-2.0.0.a3
- old
+ new
@@ -11,26 +11,10 @@
def fail_with(message, expected=nil, target=nil) # :nodoc:
if message.nil?
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)
elsif !target.is_a?(Proc)
message << "\nDiff:" << self.differ.diff_as_object(target, expected)
@@ -38,6 +22,6 @@
end
Kernel::raise(Rspec::Expectations::ExpectationNotMetError.new(message))
end
end
end
-end
\ No newline at end of file
+end