spec/rubocop/cop/rspec/cop_spec.rb in rubocop-rspec-1.9.1 vs spec/rubocop/cop/rspec/cop_spec.rb in rubocop-rspec-1.10.0
- old
+ new
@@ -18,18 +18,21 @@
RuboCop::Config.new(rubocop_config, 'fake_cop_config.yml')
end
let(:fake_cop) do
- Class.new(described_class) do
+ stub_const('RuboCop::RSpec', Module.new)
+ # rubocop:disable ClassAndModuleChildren
+ class RuboCop::RSpec::FakeCop < described_class
def self.name
'RuboCop::RSpec::FakeCop'
end
def on_send(node)
add_offense(node, :expression, 'I flag everything')
end
end
+ RuboCop::RSpec::FakeCop
end
let(:rspec_patterns) { ['_spec.rb$', '(?:^|/)spec/'] }
context 'when the source path ends with `_spec.rb`' do