Skip to content

Commit

Permalink
Revert "fix bug diffing single strings with multiline strings"
Browse files Browse the repository at this point in the history
This reverts commit 07dd19c.
  • Loading branch information
dchelimsky committed Mar 17, 2012
1 parent 07dd19c commit 2c23be3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion lib/rspec/matchers/built_in/include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Include
include BaseMatcher

def initialize(*expected)
expected.length == 1 && String === expected.first ? super(expected.first) : super(expected)
super(expected)
end

def matches?(actual)
Expand Down
10 changes: 0 additions & 10 deletions spec/rspec/matchers/include_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,11 @@
"abc".should include("a")
end

it "passes if multiline target includes expected" do
"\nabc\ndef".should include("a")
end

it "fails if target does not include expected" do
lambda {
"abc".should include("d")
}.should fail_matching("expected \"abc\" to include \"d\"")
end

it "fails if multiline target does not include expected" do
lambda {
"abc\ndef".should include("g")
}.should raise_exception(/expected "abc\\ndef" to include "g"\nDiff/m)
end
end

context "for an array target" do
Expand Down

0 comments on commit 2c23be3

Please sign in to comment.