From bd473a7da49bec12560515fb5d0e7a2feb491e79 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Tue, 23 Jul 2019 23:08:55 +0300 Subject: [PATCH] Minor documentation fix in LeakyConstantDeclaration cop --- lib/rubocop/cop/rspec/leaky_constant_declaration.rb | 10 ++++++---- manual/cops_rspec.md | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/rubocop/cop/rspec/leaky_constant_declaration.rb b/lib/rubocop/cop/rspec/leaky_constant_declaration.rb index b39e61332..155aef735 100644 --- a/lib/rubocop/cop/rspec/leaky_constant_declaration.rb +++ b/lib/rubocop/cop/rspec/leaky_constant_declaration.rb @@ -47,10 +47,12 @@ module RSpec # end # # # good - anonymous class, no constant needs to be defined - # let(:foo_class) do - # Class.new(described_class) do - # def double_that - # some_base_method * 2 + # describe SomeClass do + # let(:foo_class) do + # Class.new(described_class) do + # def double_that + # some_base_method * 2 + # end # end # end # diff --git a/manual/cops_rspec.md b/manual/cops_rspec.md index e2b15a6c1..c90fb48d2 100644 --- a/manual/cops_rspec.md +++ b/manual/cops_rspec.md @@ -1530,10 +1530,12 @@ describe SomeClass do end # good - anonymous class, no constant needs to be defined -let(:foo_class) do - Class.new(described_class) do - def double_that - some_base_method * 2 +describe SomeClass do + let(:foo_class) do + Class.new(described_class) do + def double_that + some_base_method * 2 + end end end