mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove or skip mock, double, and stub tests
This commit is contained in:
parent
0c7f72dc78
commit
b83c6b7b1e
10 changed files with 30 additions and 268 deletions
|
@ -7,11 +7,9 @@ Spectator.describe "GitHub Issue #28" do
|
|||
end
|
||||
end
|
||||
|
||||
mock Test do
|
||||
stub foo
|
||||
end
|
||||
# mock Test
|
||||
|
||||
it "matches method stubs with no_args" do
|
||||
xit "matches method stubs with no_args", pending: "Mock redesign" do
|
||||
test = Test.new
|
||||
expect(test).to receive(:foo).with(no_args).and_return(42)
|
||||
test.foo
|
||||
|
|
|
@ -7,12 +7,12 @@ Spectator.describe "GitHub Issue #29" do
|
|||
end
|
||||
end
|
||||
|
||||
mock SomeClass do
|
||||
stub exit(code)
|
||||
end
|
||||
# mock SomeClass do
|
||||
# inject_stub abstract def exit(code)
|
||||
# end
|
||||
|
||||
describe SomeClass do
|
||||
it "captures exit" do
|
||||
xit "captures exit", pending: "Mock redesign" do
|
||||
expect(subject).to receive(:exit).with(0)
|
||||
subject.goodbye
|
||||
end
|
||||
|
@ -25,13 +25,13 @@ Spectator.describe "GitHub Issue #29" do
|
|||
end
|
||||
end
|
||||
|
||||
mock Foo do
|
||||
stub self.exit(code)
|
||||
end
|
||||
# mock Foo do
|
||||
# inject_stub abstract def self.exit(code)
|
||||
# end
|
||||
|
||||
subject { Foo }
|
||||
|
||||
it "must capture exit" do
|
||||
xit "must capture exit", pending: "Mock redesign" do
|
||||
expect(subject).to receive(:exit).with(0)
|
||||
|
||||
subject.test
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe "GitHub Issue #30" do
|
||||
let(dbl) { double(:foo) }
|
||||
# let(dbl) { double(:foo) }
|
||||
|
||||
it "supports block-less symbol doubles" do
|
||||
xit "supports block-less symbol doubles", pending: "Mock redesign" do
|
||||
expect(dbl).to_not be_nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,12 +21,12 @@ Spectator.describe "GitHub Issue #32" do
|
|||
let(test_instance) { test_class.new }
|
||||
|
||||
describe "something else" do
|
||||
mock TestFoo::TestClass do
|
||||
stub self.new
|
||||
stub test
|
||||
end
|
||||
# mock TestFoo::TestClass do
|
||||
# stub self.new
|
||||
# stub test
|
||||
# end
|
||||
|
||||
it "must test when new is called" do
|
||||
xit "must test when new is called", pending: "Mock redesign" do
|
||||
expect(test_class).to receive(:new).with(no_args).and_return(test_instance)
|
||||
expect(test_instance).to receive(:test)
|
||||
expect(test_class.new).to be(test_instance)
|
||||
|
|
|
@ -10,13 +10,13 @@ Spectator.describe "GitHub Issue #33" do
|
|||
end
|
||||
end
|
||||
|
||||
mock Test do
|
||||
stub method2
|
||||
end
|
||||
# mock Test do
|
||||
# stub method2
|
||||
# end
|
||||
|
||||
describe Test do
|
||||
describe "#method1" do
|
||||
it do
|
||||
xit pending: "Mock redesign" do
|
||||
expect(subject).to receive(:method2)
|
||||
|
||||
subject.method1
|
||||
|
|
|
@ -25,12 +25,12 @@ class Sdk < SdkInterface
|
|||
end
|
||||
|
||||
Spectator.describe Example do
|
||||
mock Sdk do
|
||||
stub register_hook(name, &block)
|
||||
end
|
||||
# mock Sdk do
|
||||
# stub register_hook(name, &block)
|
||||
# end
|
||||
|
||||
describe "#configure" do
|
||||
it "registers a block on configure" do
|
||||
xit "registers a block on configure", pending: "Mock redesign" do
|
||||
sdk = Sdk.new
|
||||
example_class = Example.new(sdk)
|
||||
allow(sdk).to receive(register_hook())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue