spec/rubocop/cop/rspec/nested_groups_spec.rb in rubocop-rspec-1.9.1 vs spec/rubocop/cop/rspec/nested_groups_spec.rb in rubocop-rspec-1.10.0
- old
+ new
@@ -31,12 +31,12 @@
end
end
RUBY
end
- context 'when MaxNesting is configured as 2' do
- let(:cop_config) { { 'MaxNesting' => '2' } }
+ context 'when Max is configured as 2' do
+ let(:cop_config) { { 'Max' => '2' } }
it 'flags two levels of nesting' do
expect_violation(<<-RUBY)
describe MyClass do
context 'when foo' do
@@ -47,8 +47,20 @@
end
end
end
end
RUBY
+ end
+ end
+
+ context 'when configured with MaxNesting' do
+ let(:cop_config) { { 'MaxNesting' => '1' } }
+
+ it 'emits a deprecation warning' do
+ expect { inspect_source(cop, 'describe(Foo) { }', 'foo_spec.rb') }
+ .to output(
+ 'Configuration key `MaxNesting` for RSpec/NestedGroups is ' \
+ "deprecated in favor of `Max`. Please use that instead.\n"
+ ).to_stderr
end
end
end