Skip to content

Commit

Permalink
Merge pull request #788 from pirj/minor-doc-fix-in-leaky-constant-cop
Browse files Browse the repository at this point in the history
Documentation fix for LeakyConstantDeclaration cop
  • Loading branch information
Darhazer authored Jul 24, 2019
2 parents bcb7ce2 + bd473a7 commit b1d531c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions lib/rubocop/cop/rspec/leaky_constant_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
10 changes: 6 additions & 4 deletions manual/cops_rspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b1d531c

Please sign in to comment.