From aa94ec0e333d136ab73c94e7c8a1237ecbcbe7f6 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 26 Jan 2019 16:44:46 -0700 Subject: [PATCH] Sub-types should be not match --- spec/matchers/type_matcher_spec.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/matchers/type_matcher_spec.cr b/spec/matchers/type_matcher_spec.cr index 0629cbf..dd7e7fb 100644 --- a/spec/matchers/type_matcher_spec.cr +++ b/spec/matchers/type_matcher_spec.cr @@ -29,6 +29,15 @@ describe Spectator::Matchers::TypeMatcher do end end + context "with a child type" do + it "is false" do + value = Exception.new("foobar") + partial = Spectator::Expectations::ValueExpectationPartial.new(value) + matcher = Spectator::Matchers::TypeMatcher(ArgumentError).new + matcher.match?(partial).should be_false + end + end + context "with a mix-in" do it "is true" do value = %i[a b c]