From 1db5341f4b3bb27c50ffc49dbce0d84db2014d2e Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 3 Mar 2019 19:31:39 -0700 Subject: [PATCH] Add tests for match data values --- spec/matchers/case_matcher_spec.cr | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spec/matchers/case_matcher_spec.cr b/spec/matchers/case_matcher_spec.cr index 486e6ea..42482c2 100644 --- a/spec/matchers/case_matcher_spec.cr +++ b/spec/matchers/case_matcher_spec.cr @@ -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