mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix have
matcher tests for multiple arguments
This commit is contained in:
parent
0c4ffdf587
commit
239779135f
1 changed files with 26 additions and 26 deletions
|
@ -8,7 +8,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobarbaz"
|
||||
search = "bar"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
||||
|
@ -17,7 +17,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = "foo"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = "bar"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
end
|
||||
|
@ -48,7 +48,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = 'o'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
||||
|
@ -57,7 +57,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = 'f'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -67,7 +67,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = 'r'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -78,7 +78,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = 'z'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
end
|
||||
|
@ -90,7 +90,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %i[a b c]
|
||||
search = :b
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
||||
|
@ -99,7 +99,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %i[a b c]
|
||||
search = :a
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -109,7 +109,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %i[a b c]
|
||||
search = :c
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -120,7 +120,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %i[a b c]
|
||||
search = :z
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
end
|
||||
|
@ -129,7 +129,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
it "is true" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
||||
|
@ -137,7 +137,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
it "is true" do
|
||||
array = [:a, 1, 2]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -146,7 +146,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
it "is true" do
|
||||
array = [0, 1, :c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -156,7 +156,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
it "is false" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(Int32)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({Int32})
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
end
|
||||
|
@ -166,7 +166,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %w[FOO BAR BAZ]
|
||||
search = /bar/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
||||
|
@ -175,7 +175,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %w[FOO BAR BAZ]
|
||||
search = /foo/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -185,7 +185,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %w[FOO BAR BAZ]
|
||||
search = /baz/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
end
|
||||
|
@ -196,7 +196,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
array = %w[FOO BAR BAZ]
|
||||
search = /qux/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
end
|
||||
|
@ -209,7 +209,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
search = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.message(partial).should contain(label)
|
||||
end
|
||||
|
||||
|
@ -218,7 +218,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
search = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(label, search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(label, {search})
|
||||
matcher.message(partial).should contain(label)
|
||||
end
|
||||
|
||||
|
@ -227,7 +227,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.message(partial).should contain(search)
|
||||
end
|
||||
end
|
||||
|
@ -239,7 +239,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
search = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.negated_message(partial).should contain(label)
|
||||
end
|
||||
|
||||
|
@ -248,7 +248,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
search = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(label, search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(label, {search})
|
||||
matcher.negated_message(partial).should contain(label)
|
||||
end
|
||||
|
||||
|
@ -257,7 +257,7 @@ describe Spectator::Matchers::HaveMatcher do
|
|||
value = "foobar"
|
||||
search = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||
matcher.negated_message(partial).should contain(search)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue