mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add a couple of type tests
This commit is contained in:
parent
840da3a8b7
commit
c3d7aef7a9
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue