Check for mentions of first and last

This commit is contained in:
Michael Miller 2019-01-31 22:13:50 -07:00
parent a91758b3f3
commit 5f9c0385ad
2 changed files with 28 additions and 0 deletions

View File

@ -202,6 +202,13 @@ describe Spectator::Matchers::EndWithMatcher do
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)
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
matcher.message(partial).should contain("last")
end
end
it "contains the actual label" do
@ -251,6 +258,13 @@ describe Spectator::Matchers::EndWithMatcher do
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)
matcher = Spectator::Matchers::EndWithMatcher.new(array.last)
matcher.negated_message(partial).should contain("last")
end
end
it "contains the actual label" do

View File

@ -202,6 +202,13 @@ describe Spectator::Matchers::StartWithMatcher do
matcher = Spectator::Matchers::StartWithMatcher.new(array.first)
matcher.message(partial).should contain("===")
end
it "mentions first" do
array = %i[a b c]
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::StartWithMatcher.new(array.first)
matcher.message(partial).should contain("first")
end
end
it "contains the actual label" do
@ -251,6 +258,13 @@ describe Spectator::Matchers::StartWithMatcher do
matcher = Spectator::Matchers::StartWithMatcher.new(array.first)
matcher.negated_message(partial).should contain("===")
end
it "mentions first" do
array = %i[a b c]
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
matcher = Spectator::Matchers::StartWithMatcher.new(array.first)
matcher.negated_message(partial).should contain("first")
end
end
it "contains the actual label" do