spec/rubocop/cop/rspec/example_length_spec.rb in rubocop-rspec-1.5.1 vs spec/rubocop/cop/rspec/example_length_spec.rb in rubocop-rspec-1.5.2
- old
+ new
@@ -1,11 +1,25 @@
-# encoding: utf-8
-
describe RuboCop::Cop::RSpec::ExampleLength, :config do
subject(:cop) { described_class.new(config) }
let(:cop_config) { { 'Max' => 3 } }
+ it 'ignores non-spec blocks' do
+ inspect_source(
+ cop,
+ [
+ 'foo do',
+ ' line 1',
+ ' line 2',
+ ' line 3',
+ ' line 4',
+ 'end'
+ ]
+ )
+
+ expect(cop.offenses).to be_empty
+ end
+
it 'allows an empty example' do
inspect_source(
cop,
[
'it do',
@@ -27,10 +41,10 @@
]
)
expect(cop.offenses).to be_empty
end
- it 'doesn\t allow a long example' do
+ it "doesn't allow a long example" do
inspect_source(
cop,
[
'it do',
' line 1',