spec/rubocop/cop/rspec/nested_groups_spec.rb in rubocop-rspec-1.24.0 vs spec/rubocop/cop/rspec/nested_groups_spec.rb in rubocop-rspec-1.25.0
- old
+ new
@@ -20,9 +20,24 @@
end
end
RUBY
end
+ it 'support --auto-gen-config' do
+ inspect_source(<<-RUBY, 'spec/foo_spec.rb')
+ describe MyClass do
+ context 'when foo' do
+ context 'when bar' do
+ context 'when baz' do
+ end
+ end
+ end
+ end
+ RUBY
+
+ expect(cop.config_to_allow_offenses).to eq('Max' => 4)
+ end
+
it 'ignores non-spec context methods' do
expect_no_offenses(<<-RUBY)
class MyThingy
context 'this is not rspec' do
context 'but it uses contexts' do