Fix contain matcher tests for multiple arguments

This commit is contained in:
Michael Miller 2019-02-01 19:45:30 -07:00
parent 85b4e6894b
commit acea12cafb

View file

@ -8,7 +8,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobarbaz" value = "foobarbaz"
search = "bar" search = "bar"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
@ -17,7 +17,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = "foo" search = "foo"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -27,7 +27,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = "bar" search = "bar"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -38,7 +38,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = "baz" search = "baz"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_false matcher.match?(partial).should be_false
end end
end end
@ -48,7 +48,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = 'o' search = 'o'
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
@ -57,7 +57,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = 'f' search = 'f'
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -67,7 +67,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = 'r' search = 'r'
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -78,7 +78,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = 'z' search = 'z'
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_false matcher.match?(partial).should be_false
end end
end end
@ -90,7 +90,7 @@ describe Spectator::Matchers::ContainMatcher do
array = %i[a b c] array = %i[a b c]
search = :b search = :b
partial = Spectator::Expectations::ValueExpectationPartial.new(array) partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
@ -99,7 +99,7 @@ describe Spectator::Matchers::ContainMatcher do
array = %i[a b c] array = %i[a b c]
search = :a search = :a
partial = Spectator::Expectations::ValueExpectationPartial.new(array) partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -109,7 +109,7 @@ describe Spectator::Matchers::ContainMatcher do
array = %i[a b c] array = %i[a b c]
search = :c search = :c
partial = Spectator::Expectations::ValueExpectationPartial.new(array) partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_true matcher.match?(partial).should be_true
end end
end end
@ -120,7 +120,7 @@ describe Spectator::Matchers::ContainMatcher do
array = %i[a b c] array = %i[a b c]
search = :z search = :z
partial = Spectator::Expectations::ValueExpectationPartial.new(array) partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.match?(partial).should be_false matcher.match?(partial).should be_false
end end
end end
@ -133,7 +133,7 @@ describe Spectator::Matchers::ContainMatcher do
search = "baz" search = "baz"
label = "everything" label = "everything"
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value) partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.message(partial).should contain(label) matcher.message(partial).should contain(label)
end end
@ -142,7 +142,7 @@ describe Spectator::Matchers::ContainMatcher do
search = "baz" search = "baz"
label = "everything" label = "everything"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(label, search) matcher = Spectator::Matchers::ContainMatcher.new(label, {search})
matcher.message(partial).should contain(label) matcher.message(partial).should contain(label)
end end
@ -151,7 +151,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = "baz" search = "baz"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.message(partial).should contain(search) matcher.message(partial).should contain(search)
end end
end end
@ -163,7 +163,7 @@ describe Spectator::Matchers::ContainMatcher do
search = "baz" search = "baz"
label = "everything" label = "everything"
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value) partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.negated_message(partial).should contain(label) matcher.negated_message(partial).should contain(label)
end end
@ -172,7 +172,7 @@ describe Spectator::Matchers::ContainMatcher do
search = "baz" search = "baz"
label = "everything" label = "everything"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(label, search) matcher = Spectator::Matchers::ContainMatcher.new(label, {search})
matcher.negated_message(partial).should contain(label) matcher.negated_message(partial).should contain(label)
end end
@ -181,7 +181,7 @@ describe Spectator::Matchers::ContainMatcher do
value = "foobar" value = "foobar"
search = "baz" search = "baz"
partial = Spectator::Expectations::ValueExpectationPartial.new(value) partial = Spectator::Expectations::ValueExpectationPartial.new(value)
matcher = Spectator::Matchers::ContainMatcher.new(search) matcher = Spectator::Matchers::ContainMatcher.new({search})
matcher.negated_message(partial).should contain(search) matcher.negated_message(partial).should contain(search)
end end
end end