mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Merge master into release/0.10
This commit is contained in:
parent
8d32984eba
commit
6a01ab3531
8 changed files with 111 additions and 19 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
|
20
spec/issues/github_issue_29_spec.cr
Normal file
20
spec/issues/github_issue_29_spec.cr
Normal file
|
@ -0,0 +1,20 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe "GitHub Issue #29" do
|
||||
class SomeClass
|
||||
def goodbye
|
||||
exit 0
|
||||
end
|
||||
end
|
||||
|
||||
mock SomeClass do
|
||||
stub exit(code)
|
||||
end
|
||||
|
||||
describe SomeClass do
|
||||
it "captures exit" do
|
||||
expect(subject).to receive(:exit).with(0)
|
||||
subject.goodbye
|
||||
end
|
||||
end
|
||||
end
|
9
spec/issues/github_issue_30_spec.cr
Normal file
9
spec/issues/github_issue_30_spec.cr
Normal file
|
@ -0,0 +1,9 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe "GitHub Issue #30" do
|
||||
let(dbl) { double(:foo) }
|
||||
|
||||
it "supports block-less symbol doubles" do
|
||||
expect(dbl).to_not be_nil
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue