summaryrefslogtreecommitdiff
path: root/spec/rubocop/cop
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop')
-rw-r--r--spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb4
-rw-r--r--spec/rubocop/cop/avoid_return_from_blocks_spec.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
index 62f6c7a3414..feb85c354ef 100644
--- a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
+++ b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
@@ -62,7 +62,9 @@ describe RuboCop::Cop::AvoidBreakFromStrongMemoize do
end
end
RUBY
- expect_any_instance_of(described_class).to receive(:add_offense).once
+ expect_next_instance_of(described_class) do |instance|
+ expect(instance).to receive(:add_offense).once
+ end
inspect_source(source)
end
diff --git a/spec/rubocop/cop/avoid_return_from_blocks_spec.rb b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb
index 133d286ccd2..919cd3d98f3 100644
--- a/spec/rubocop/cop/avoid_return_from_blocks_spec.rb
+++ b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb
@@ -29,7 +29,9 @@ describe RuboCop::Cop::AvoidReturnFromBlocks do
end
end
RUBY
- expect_any_instance_of(described_class).to receive(:add_offense).once
+ expect_next_instance_of(described_class) do |instance|
+ expect(instance).to receive(:add_offense).once
+ end
inspect_source(source)
end