From c3d7aef7a913ff9950211d9518a0b3ec08756d4a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 26 Jan 2019 16:34:58 -0700 Subject: [PATCH] Add a couple of type tests --- spec/matchers/type_matcher_spec.cr | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/matchers/type_matcher_spec.cr b/spec/matchers/type_matcher_spec.cr index 0eab5b1..0629cbf 100644 --- a/spec/matchers/type_matcher_spec.cr +++ b/spec/matchers/type_matcher_spec.cr @@ -19,6 +19,24 @@ describe Spectator::Matchers::TypeMatcher do matcher.match?(partial).should be_false end end + + context "with a parent type" do + it "is true" do + value = IO::Memory.new + partial = Spectator::Expectations::ValueExpectationPartial.new(value) + matcher = Spectator::Matchers::TypeMatcher(IO).new + matcher.match?(partial).should be_true + end + end + + context "with a mix-in" do + it "is true" do + value = %i[a b c] + partial = Spectator::Expectations::ValueExpectationPartial.new(value) + matcher = Spectator::Matchers::TypeMatcher(Enumerable(Symbol)).new + matcher.match?(partial).should be_true + end + end end describe "#message" do