mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Test type restricted methods with class mocks
This commit is contained in:
parent
5008923226
commit
ccc8997cca
1 changed files with 16 additions and 0 deletions
|
@ -359,6 +359,14 @@ Spectator.describe Spectator::Mock do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def restricted(thing : Thing.class)
|
||||||
|
thing.foo
|
||||||
|
end
|
||||||
|
|
||||||
|
it "can be used in type restricted methods" do
|
||||||
|
expect(restricted(mock)).to eq(:stub)
|
||||||
|
end
|
||||||
|
|
||||||
describe "._spectator_clear_stubs" do
|
describe "._spectator_clear_stubs" do
|
||||||
before_each { mock._spectator_define_stub(foo_stub) }
|
before_each { mock._spectator_define_stub(foo_stub) }
|
||||||
|
|
||||||
|
@ -670,6 +678,14 @@ Spectator.describe Spectator::Mock do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def restricted(thing : Thing.class)
|
||||||
|
thing.foo
|
||||||
|
end
|
||||||
|
|
||||||
|
it "can be used in type restricted methods" do
|
||||||
|
expect(restricted(mock)).to eq(:stub)
|
||||||
|
end
|
||||||
|
|
||||||
describe "._spectator_clear_stubs" do
|
describe "._spectator_clear_stubs" do
|
||||||
before_each { mock._spectator_define_stub(foo_stub) }
|
before_each { mock._spectator_define_stub(foo_stub) }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue