diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4aa6c40b7..fc659ba2c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -111,14 +111,6 @@ RSpec/DescribeClass: RSpec/ExampleLength: Max: 9 -# Offense count: 2 -# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/FilePath: - Exclude: - - 'spec/unit/puppet/provider/file_line/ruby_spec_alter.rb' - - 'spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb' - # Offense count: 2 RSpec/LeakyConstantDeclaration: Exclude: diff --git a/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb b/spec/unit/puppet/provider/file_line/ruby_alter_spec.rb similarity index 98% rename from spec/unit/puppet/provider/file_line/ruby_spec_alter.rb rename to spec/unit/puppet/provider/file_line/ruby_alter_spec.rb index 268157fa2..8b10a413c 100644 --- a/spec/unit/puppet/provider/file_line/ruby_spec_alter.rb +++ b/spec/unit/puppet/provider/file_line/ruby_alter_spec.rb @@ -164,7 +164,7 @@ end context 'when match and after set' do - shared_context 'when resource_create' do + shared_context 'resource_create' do let(:match) { '^foo2$' } let(:after) { '^foo1$' } let(:resource) do @@ -251,7 +251,7 @@ it 'appends the specified line to the file' do provider.create - expect(File.read(tmpfile)).to eq(content << resource[:line] << "\n") + expect(File.read(tmpfile)).to eq("#{content}#{resource[:line]}\n") end end end @@ -385,4 +385,5 @@ expect(File.read(tmpfile)).to eql("foo1\nfoo2\nfoo4\n") end end + # rubocop:enable RSpec/InstanceVariable end diff --git a/spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb b/spec/unit/puppet/provider/file_line/ruby_use_cases_spec.rb similarity index 100% rename from spec/unit/puppet/provider/file_line/ruby_spec_use_cases.rb rename to spec/unit/puppet/provider/file_line/ruby_use_cases_spec.rb