Permalink
Browse files

Remove unnecessary "else" clause.

  • Loading branch information...
1 parent 0492d87 commit 584e76483cfc23f5507e34253a80e0bc873d2ea3 @justinko justinko committed Mar 22, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 lib/rspec/expectations/fail_with.rb
@@ -5,7 +5,7 @@ class << self
def differ
@differ ||= Differ.new
end
-
+
# Raises an RSpec::Expectations::ExpectationNotMetError with message.
# @param [String] message
# @param [Object] expected
@@ -22,11 +22,8 @@ def fail_with(message, expected=nil, actual=nil)
if actual && expected
if all_strings?(actual, expected)
if any_multiline_strings?(actual, expected)
- if Array === expected
- message << "\nDiff:" << differ.diff_as_string(actual, expected.join(","))
- else
- message << "\nDiff:" << differ.diff_as_string(actual, expected)
- end
+ expected = expected.join(',') if Array === expected
+ message << "\nDiff:" << differ.diff_as_string(actual, expected)
end
elsif no_procs?(actual, expected) && no_numbers?(actual, expected)
message << "\nDiff:" << differ.diff_as_object(actual, expected)

0 comments on commit 584e764

Please sign in to comment.