Add tests for match data values

This commit is contained in:
Michael Miller 2019-03-03 19:31:39 -07:00
parent cdef7f9fa3
commit 1db5341f4b

View file

@ -91,6 +91,30 @@ describe Spectator::Matchers::CaseMatcher do
end
end
describe "#values" do
context "expected" do
it "is the expected value" do
actual = "foobar"
expected = /foo/
partial = new_partial(actual)
matcher = Spectator::Matchers::CaseMatcher.new(expected)
match_data = matcher.match(partial)
match_data.values[:expected].should eq(expected)
end
end
context "actual" do
it "is the actual value" do
actual = "foobar"
expected = /foo/
partial = new_partial(actual)
matcher = Spectator::Matchers::CaseMatcher.new(expected)
match_data = matcher.match(partial)
match_data.values[:actual].should eq(actual)
end
end
end
describe "#message" do
it "mentions ===" do
value = 42