mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add no_args support for stubs
Fixes https://github.com/icy-arctic-fox/spectator/issues/28
This commit is contained in:
parent
92f758084d
commit
e3f6fb3c7c
4 changed files with 48 additions and 0 deletions
19
spec/issues/github_issue_28_spec.cr
Normal file
19
spec/issues/github_issue_28_spec.cr
Normal file
|
@ -0,0 +1,19 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe "GitHub Issue #28" do
|
||||
class Test
|
||||
def foo
|
||||
42
|
||||
end
|
||||
end
|
||||
|
||||
mock Test do
|
||||
stub foo
|
||||
end
|
||||
|
||||
it "matches method stubs with no_args" do
|
||||
test = Test.new
|
||||
expect(test).to receive(:foo).with(no_args).and_return(42)
|
||||
test.foo
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue