Skip to content

Commit 912ae66

Browse files
authored
Merge pull request #1056 from rubocop-hq/rf-mixins
Add mixins folder
2 parents b42f401 + 9f4d7fa commit 912ae66

25 files changed

+171
-158
lines changed

lib/rubocop-rspec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@
1212
require_relative 'rubocop/rspec/wording'
1313
require_relative 'rubocop/rspec/language'
1414
require_relative 'rubocop/rspec/language/node_pattern'
15-
require_relative 'rubocop/rspec/top_level_group'
15+
16+
require_relative 'rubocop/cop/rspec/mixin/top_level_group'
17+
require_relative 'rubocop/cop/rspec/mixin/variable'
18+
require_relative 'rubocop/cop/rspec/mixin/final_end_location'
19+
require_relative 'rubocop/cop/rspec/mixin/empty_line_separation'
20+
1621
require_relative 'rubocop/rspec/concept'
1722
require_relative 'rubocop/rspec/example_group'
1823
require_relative 'rubocop/rspec/example'
1924
require_relative 'rubocop/rspec/hook'
20-
require_relative 'rubocop/rspec/variable'
2125
require_relative 'rubocop/cop/rspec/base'
2226
require_relative 'rubocop/rspec/align_let_brace'
2327
require_relative 'rubocop/rspec/factory_bot'
24-
require_relative 'rubocop/rspec/final_end_location'
25-
require_relative 'rubocop/rspec/empty_line_separation'
2628
require_relative 'rubocop/rspec/corrector/move_node'
2729

2830
RuboCop::RSpec::Inject.defaults!

lib/rubocop/cop/rspec/describe_class.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module RSpec
3535
# describe "A feature example", type: :feature do
3636
# end
3737
class DescribeClass < Base
38-
include RuboCop::RSpec::TopLevelGroup
38+
include TopLevelGroup
3939

4040
MSG = 'The first argument to describe should be '\
4141
'the class or module being tested.'

lib/rubocop/cop/rspec/describe_method.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module RSpec
1717
# describe MyClass, '.my_class_method' do
1818
# end
1919
class DescribeMethod < Base
20-
include RuboCop::RSpec::TopLevelGroup
20+
include TopLevelGroup
2121

2222
MSG = 'The second argument to describe should be the method '\
2323
"being tested. '#instance' or '.class'."

lib/rubocop/cop/rspec/empty_line_after_example.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module RSpec
4343
#
4444
class EmptyLineAfterExample < Base
4545
extend AutoCorrector
46-
include RuboCop::RSpec::EmptyLineSeparation
46+
include EmptyLineSeparation
4747

4848
MSG = 'Add an empty line after `%<example>s`.'
4949

lib/rubocop/cop/rspec/empty_line_after_example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module RSpec
2525
#
2626
class EmptyLineAfterExampleGroup < Base
2727
extend AutoCorrector
28-
include RuboCop::RSpec::EmptyLineSeparation
28+
include EmptyLineSeparation
2929

3030
MSG = 'Add an empty line after `%<example_group>s`.'
3131

lib/rubocop/cop/rspec/empty_line_after_final_let.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module RSpec
1818
# it { does_something }
1919
class EmptyLineAfterFinalLet < Base
2020
extend AutoCorrector
21-
include RuboCop::RSpec::EmptyLineSeparation
21+
include EmptyLineSeparation
2222

2323
MSG = 'Add an empty line after the last `%<let>s`.'
2424

lib/rubocop/cop/rspec/empty_line_after_hook.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module RSpec
3535
#
3636
class EmptyLineAfterHook < Base
3737
extend AutoCorrector
38-
include RuboCop::RSpec::EmptyLineSeparation
38+
include EmptyLineSeparation
3939

4040
MSG = 'Add an empty line after `%<hook>s`.'
4141

lib/rubocop/cop/rspec/empty_line_after_subject.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module RSpec
1616
# let(:foo) { bar }
1717
class EmptyLineAfterSubject < Base
1818
extend AutoCorrector
19-
include RuboCop::RSpec::EmptyLineSeparation
19+
include EmptyLineSeparation
2020

2121
MSG = 'Add an empty line after `%<subject>s`.'
2222

lib/rubocop/cop/rspec/file_path.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module RSpec
5757
# my_class_spec.rb # describe MyClass, '#method'
5858
#
5959
class FilePath < Base
60-
include RuboCop::RSpec::TopLevelGroup
60+
include TopLevelGroup
6161

6262
MSG = 'Spec path should end with `%<suffix>s`.'
6363

lib/rubocop/cop/rspec/instance_variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module RSpec
4747
# end
4848
#
4949
class InstanceVariable < Base
50-
include RuboCop::RSpec::TopLevelGroup
50+
include TopLevelGroup
5151

5252
MSG = 'Avoid instance variables – use let, ' \
5353
'a method call, or a local variable (if possible).'

0 commit comments

Comments
 (0)