Skip to content

Commit 8981f22

Browse files
committed
update unit tests and the helper
1 parent 2b01218 commit 8981f22

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/unit/entitlements/backend/github_team/service_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@
845845
it "does not handle octokit error" do
846846
exc = StandardError.new("Whoops!")
847847
allow(subject).to receive(:octokit).and_return(octokit)
848-
expect(octokit).to receive(:team).with(1234).and_raise(exc)
848+
expect(octokit).to receive(:team).with(1234).and_raise(exc).exactly(3).times
849849

850850
expect do
851851
subject.send(:validate_team_id_and_slug!, 1234, "my-slug")

spec/unit/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ def instance_double(klass, *args)
184184

185185
config.before :each do
186186
allow(Time).to receive(:now).and_return(Time.utc(2018, 4, 1, 12, 0, 0))
187+
188+
allow(Kernel).to receive(:sleep)
189+
allow_any_instance_of(Kernel).to receive(:sleep)
190+
allow_any_instance_of(Object).to receive(:sleep)
191+
187192
allow(Entitlements).to receive(:cache).and_return(cache)
188193
if entitlements_config_hash
189194
Entitlements.config = entitlements_config_hash

0 commit comments

Comments
 (0)