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"
|
value = "foobarbaz"
|
||||||
search = "bar"
|
search = "bar"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = "foo"
|
search = "foo"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = "bar"
|
search = "bar"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = "baz"
|
search = "baz"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = 'o'
|
search = 'o'
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = 'f'
|
search = 'f'
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = 'r'
|
search = 'r'
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = 'z'
|
search = 'z'
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ describe Spectator::Matchers::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.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::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_false
|
matcher.match?(partial).should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,7 +129,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
it "is true" do
|
it "is true" do
|
||||||
array = %i[a b c]
|
array = %i[a b c]
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
it "is true" do
|
it "is true" do
|
||||||
array = [:a, 1, 2]
|
array = [:a, 1, 2]
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -146,7 +146,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
it "is true" do
|
it "is true" do
|
||||||
array = [0, 1, :c]
|
array = [0, 1, :c]
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(Symbol)
|
matcher = Spectator::Matchers::HaveMatcher.new({Symbol})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -156,7 +156,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
it "is false" do
|
it "is false" do
|
||||||
array = %i[a b c]
|
array = %i[a b c]
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(Int32)
|
matcher = Spectator::Matchers::HaveMatcher.new({Int32})
|
||||||
matcher.match?(partial).should be_false
|
matcher.match?(partial).should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -166,7 +166,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
array = %w[FOO BAR BAZ]
|
array = %w[FOO BAR BAZ]
|
||||||
search = /bar/i
|
search = /bar/i
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
array = %w[FOO BAR BAZ]
|
array = %w[FOO BAR BAZ]
|
||||||
search = /foo/i
|
search = /foo/i
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -185,7 +185,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
array = %w[FOO BAR BAZ]
|
array = %w[FOO BAR BAZ]
|
||||||
search = /baz/i
|
search = /baz/i
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_true
|
matcher.match?(partial).should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -196,7 +196,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
array = %w[FOO BAR BAZ]
|
array = %w[FOO BAR BAZ]
|
||||||
search = /qux/i
|
search = /qux/i
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.match?(partial).should be_false
|
matcher.match?(partial).should be_false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -209,7 +209,7 @@ describe Spectator::Matchers::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.message(partial).should contain(label)
|
matcher.message(partial).should contain(label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
search = "baz"
|
search = "baz"
|
||||||
label = "everything"
|
label = "everything"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
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)
|
matcher.message(partial).should contain(label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = "baz"
|
search = "baz"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||||
matcher = Spectator::Matchers::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.message(partial).should contain(search)
|
matcher.message(partial).should contain(search)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -239,7 +239,7 @@ describe Spectator::Matchers::HaveMatcher 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::HaveMatcher.new(search)
|
matcher = Spectator::Matchers::HaveMatcher.new({search})
|
||||||
matcher.negated_message(partial).should contain(label)
|
matcher.negated_message(partial).should contain(label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
search = "baz"
|
search = "baz"
|
||||||
label = "everything"
|
label = "everything"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
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)
|
matcher.negated_message(partial).should contain(label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ describe Spectator::Matchers::HaveMatcher do
|
||||||
value = "foobar"
|
value = "foobar"
|
||||||
search = "baz"
|
search = "baz"
|
||||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
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)
|
matcher.negated_message(partial).should contain(search)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue