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:
Michael Miller 2019-02-14 17:04:59 -07:00
parent ac5c2bbe47
commit 1507a447c8
25 changed files with 439 additions and 439 deletions

View file

@ -5,7 +5,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
context "with a label" do
it "contains the value passed to the constructor" do
actual = ->{ 777 }
partial = Spectator::Expectations::BlockExpectationPartial.new(actual.to_s, actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, actual.to_s, __FILE__, __LINE__)
partial.actual.should eq(actual.call)
end
end
@ -13,7 +13,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
context "without a label" do
it "contains the value passed to the constructor" do
actual = ->{ 777 }
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
partial.actual.should eq(actual.call)
end
end
@ -24,7 +24,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
it "contains the value passed to the constructor" do
actual = ->{ 777 }
label = "lucky"
partial = Spectator::Expectations::BlockExpectationPartial.new(label, actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, label, __FILE__, __LINE__)
partial.label.should eq(label)
end
end
@ -32,7 +32,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
context "when omitted" do
it "contains a stringified version of #actual" do
actual = ->{ 777 }
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
partial.label.should eq(actual.to_s)
end
end
@ -43,7 +43,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 777
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -55,7 +55,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 777
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
5.times { partial.to(matcher) }
end
@ -68,7 +68,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 777
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -82,7 +82,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 42
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -98,7 +98,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 777
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end
@ -110,7 +110,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 42
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
5.times { partial.{{method.id}}(matcher) }
end
@ -123,7 +123,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 777
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end
@ -137,7 +137,7 @@ describe Spectator::Expectations::BlockExpectationPartial do
spy = SpyExample.create do
actual = ->{ 777 }
expected = 42
partial = Spectator::Expectations::BlockExpectationPartial.new(actual)
partial = Spectator::Expectations::BlockExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end

View file

@ -5,7 +5,7 @@ describe Spectator::Expectations::Expectation do
context "with a successful match" do
it "is true" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, false, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -15,7 +15,7 @@ describe Spectator::Expectations::Expectation do
context "when negated" do
it "is false" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, true, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -28,7 +28,7 @@ describe Spectator::Expectations::Expectation do
it "is false" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, false, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.
@ -39,7 +39,7 @@ describe Spectator::Expectations::Expectation do
it "is true" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, true, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.
@ -53,7 +53,7 @@ describe Spectator::Expectations::Expectation do
context "with a successful match" do
it "equals the matcher's #message" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, false, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -63,7 +63,7 @@ describe Spectator::Expectations::Expectation do
context "when negated" do
it "equals the matcher's #negated_message" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, true, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -76,7 +76,7 @@ describe Spectator::Expectations::Expectation do
it "equals the matcher's #negated_message" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, false, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.
@ -87,7 +87,7 @@ describe Spectator::Expectations::Expectation do
it "equals the matcher's #message" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, true, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.
@ -101,7 +101,7 @@ describe Spectator::Expectations::Expectation do
context "with a successful match" do
it "equals the matcher's #message" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, false, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -111,7 +111,7 @@ describe Spectator::Expectations::Expectation do
context "when negated" do
it "equals the matcher's #negated_message" do
value = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(value.to_s, value)
partial = new_partial(value)
matcher = Spectator::Matchers::EqualityMatcher.new(value.to_s, value)
expectation = Spectator::Expectations::Expectation.new(true, true, partial, matcher)
matcher.match?(partial).should be_true # Sanity check.
@ -124,7 +124,7 @@ describe Spectator::Expectations::Expectation do
it "equals the matcher's #message" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, false, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.
@ -135,7 +135,7 @@ describe Spectator::Expectations::Expectation do
it "equals the matcher's #negated_message" do
value1 = 42
value2 = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(value1.to_s, value1)
partial = new_partial(value1)
matcher = Spectator::Matchers::EqualityMatcher.new(value2.to_s, value2)
expectation = Spectator::Expectations::Expectation.new(false, true, partial, matcher)
matcher.match?(partial).should be_false # Sanity check.

View file

@ -5,7 +5,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
context "with a label" do
it "contains the value passed to the constructor" do
actual = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual.to_s, actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, actual.to_s, __FILE__, __LINE__)
partial.actual.should eq(actual)
end
end
@ -13,7 +13,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
context "without a label" do
it "contains the value passed to the constructor" do
actual = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
partial.actual.should eq(actual)
end
end
@ -24,7 +24,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
it "contains the value passed to the constructor" do
actual = 777
label = "lucky"
partial = Spectator::Expectations::ValueExpectationPartial.new(label, actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, label, __FILE__, __LINE__)
partial.label.should eq(label)
end
end
@ -32,7 +32,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
context "when omitted" do
it "contains a stringified version of #actual" do
actual = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
partial.label.should eq(actual.to_s)
end
end
@ -43,7 +43,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -55,7 +55,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
5.times { partial.to(matcher) }
end
@ -68,7 +68,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -82,7 +82,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.to(matcher)
end
@ -98,7 +98,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end
@ -110,7 +110,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
5.times { partial.{{method.id}}(matcher) }
end
@ -123,7 +123,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 777
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end
@ -137,7 +137,7 @@ describe Spectator::Expectations::ValueExpectationPartial do
spy = SpyExample.create do
actual = 777
expected = 42
partial = Spectator::Expectations::ValueExpectationPartial.new(actual)
partial = Spectator::Expectations::ValueExpectationPartial.new(actual, __FILE__, __LINE__)
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
partial.{{method.id}}(matcher)
end