From 193a4766791a078a6f5b633b948c170dd63a4e72 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 12 Jul 2022 21:50:45 -0600 Subject: [PATCH] Update known issues to use new mock system --- spec/issues/github_issue_28_spec.cr | 6 +++--- spec/issues/github_issue_33_spec.cr | 8 ++++---- spec/issues/github_issue_42_spec.cr | 8 +++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/spec/issues/github_issue_28_spec.cr b/spec/issues/github_issue_28_spec.cr index d964d62..e6b6924 100644 --- a/spec/issues/github_issue_28_spec.cr +++ b/spec/issues/github_issue_28_spec.cr @@ -7,10 +7,10 @@ Spectator.describe "GitHub Issue #28" do end end - # mock Test + mock Test - xit "matches method stubs with no_args", pending: "Mock redesign" do - test = Test.new + it "matches method stubs with no_args" do + test = mock(Test) expect(test).to receive(:foo).with(no_args).and_return(42) test.foo end diff --git a/spec/issues/github_issue_33_spec.cr b/spec/issues/github_issue_33_spec.cr index d8278d1..656a273 100644 --- a/spec/issues/github_issue_33_spec.cr +++ b/spec/issues/github_issue_33_spec.cr @@ -10,13 +10,13 @@ Spectator.describe "GitHub Issue #33" do end end - # mock Test do - # stub method2 - # end + mock Test describe Test do + subject { mock(Test) } + describe "#method1" do - xit pending: "Mock redesign" do + it do expect(subject).to receive(:method2) subject.method1 diff --git a/spec/issues/github_issue_42_spec.cr b/spec/issues/github_issue_42_spec.cr index ba8a4ac..58ff2b2 100644 --- a/spec/issues/github_issue_42_spec.cr +++ b/spec/issues/github_issue_42_spec.cr @@ -25,13 +25,11 @@ class Sdk < SdkInterface end Spectator.describe Example do - # mock Sdk do - # stub register_hook(name, &block) - # end + mock Sdk describe "#configure" do - xit "registers a block on configure", pending: "Mock redesign" do - sdk = Sdk.new + it "registers a block on configure" do + sdk = mock(Sdk) example_class = Example.new(sdk) allow(sdk).to receive(register_hook())