From e234ac2f310c2e8de8be99f88455e5b05a647385 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 1 Jun 2019 20:55:29 -0600 Subject: [PATCH] Test case to ensure runtime type is reported --- spec/matchers/type_matcher_spec.cr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/matchers/type_matcher_spec.cr b/spec/matchers/type_matcher_spec.cr index 81a430b..7489b28 100644 --- a/spec/matchers/type_matcher_spec.cr +++ b/spec/matchers/type_matcher_spec.cr @@ -74,6 +74,14 @@ describe Spectator::Matchers::TypeMatcher do match_data = matcher.match(partial) match_data_value_sans_prefix(match_data.values, :actual)[:value].should eq(typeof(value)) end + + it "is the runtime type name" do + value = 42.as(Int32?) + partial = new_partial(value) + matcher = Spectator::Matchers::TypeMatcher(String).new + match_data = matcher.match(partial) + match_data_value_sans_prefix(match_data.values, :actual)[:value].should eq(value.class) + end end end