mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Update specs to use new source arguments
Used `new_partial` where the underlying partial didn't matter for the test.
This commit is contained in:
parent
ac5c2bbe47
commit
1507a447c8
25 changed files with 439 additions and 439 deletions
|
@ -7,7 +7,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is true" do
|
||||
value = "foobar"
|
||||
last = "bar"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "foobar"
|
||||
last = "foo"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "foobar"
|
||||
last = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -37,7 +37,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is true" do
|
||||
value = "foobar"
|
||||
last = 'r'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -46,7 +46,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "foobar"
|
||||
last = 'b'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "foobar"
|
||||
last = 'z'
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -67,7 +67,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is true" do
|
||||
value = "FOOBAR"
|
||||
last = /bar/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -76,7 +76,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "FOOBAR"
|
||||
last = /foo/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -87,7 +87,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
value = "FOOBAR"
|
||||
last = /baz/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -99,7 +99,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is true" do
|
||||
array = %i[a b c]
|
||||
last = :c
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -108,7 +108,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
array = %i[a b c]
|
||||
last = :b
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -119,7 +119,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
array = %i[a b c]
|
||||
last = :z
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
context "against matching element type" do
|
||||
it "is true" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(Symbol)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -136,7 +136,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
context "not at end" do
|
||||
it "is false" do
|
||||
array = [1, 2, 3, :a, :b, :c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(Int32)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -146,7 +146,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
context "against different element type" do
|
||||
it "is false" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(Int32)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -156,7 +156,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is true" do
|
||||
array = %w[FOO BAR BAZ]
|
||||
last = /baz/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_true
|
||||
end
|
||||
|
@ -165,7 +165,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
array = %w[FOO BAR BAZ]
|
||||
last = /bar/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -176,7 +176,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "is false" do
|
||||
array = %w[FOO BAR BAZ]
|
||||
last = /qux/i
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.match?(partial).should be_false
|
||||
end
|
||||
|
@ -189,7 +189,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "mentions #ends_with?" do
|
||||
value = "foobar"
|
||||
last = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.message(partial).should contain("#starts_with?")
|
||||
end
|
||||
|
@ -198,14 +198,14 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
context "with an Enumerable" do
|
||||
it "mentions ===" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
|
||||
matcher.message(partial).should contain("===")
|
||||
end
|
||||
|
||||
it "mentions last" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
|
||||
matcher.message(partial).should contain("last")
|
||||
end
|
||||
|
@ -215,7 +215,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
value = "foobar"
|
||||
last = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
|
||||
partial = new_partial(value, label)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.message(partial).should contain(label)
|
||||
end
|
||||
|
@ -224,7 +224,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
value = "foobar"
|
||||
last = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(label, last)
|
||||
matcher.message(partial).should contain(label)
|
||||
end
|
||||
|
@ -233,7 +233,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "contains stringified form of expected value" do
|
||||
value = "foobar"
|
||||
last = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.message(partial).should contain(last)
|
||||
end
|
||||
|
@ -245,7 +245,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "mentions #starts_with?" do
|
||||
value = "foobar"
|
||||
last = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.negated_message(partial).should contain("#starts_with?")
|
||||
end
|
||||
|
@ -254,14 +254,14 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
context "with an Enumerable" do
|
||||
it "mentions ===" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
|
||||
matcher.negated_message(partial).should contain("===")
|
||||
end
|
||||
|
||||
it "mentions last" do
|
||||
array = %i[a b c]
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
partial = new_partial(array)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
|
||||
matcher.negated_message(partial).should contain("last")
|
||||
end
|
||||
|
@ -271,7 +271,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
value = "foobar"
|
||||
last = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(label, value)
|
||||
partial = new_partial(value, label)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.negated_message(partial).should contain(label)
|
||||
end
|
||||
|
@ -280,7 +280,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
value = "foobar"
|
||||
last = "baz"
|
||||
label = "everything"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(label, last)
|
||||
matcher.negated_message(partial).should contain(label)
|
||||
end
|
||||
|
@ -289,7 +289,7 @@ describe Spectator::Matchers::EndWithMatcher do
|
|||
it "contains stringified form of expected value" do
|
||||
value = "foobar"
|
||||
last = "baz"
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(value)
|
||||
partial = new_partial(value)
|
||||
matcher = Spectator::Matchers::EndWithMatcher.new(last)
|
||||
matcher.negated_message(partial).should contain(last)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue