Skip to content

Commit

Permalink
[rubocop] fix Layout/HeredocIndentation
Browse files Browse the repository at this point in the history
Signed-off-by: David Crosby <[email protected]>
  • Loading branch information
dafyddcrosby committed Jan 23, 2024
1 parent 0085f73 commit e4620f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions spec/rubocop/cop/chef/ruby/gemspec_require_rubygems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

it 'registers an offense when requiring rubygems' do
expect_offense(<<~RUBY)
require "rubygems"
^^^^^^^^^^^^^^^^^^ Rubygems does not need to be required in a Gemspec. It's already loaded out of the box in Ruby now.
require "rubygems"
^^^^^^^^^^^^^^^^^^ Rubygems does not need to be required in a Gemspec. It's already loaded out of the box in Ruby now.
RUBY

expect_correction("\n")
end

it 'registers an offense when requiring rubygems with a conditional' do
expect_offense(<<~RUBY)
require "rubygems" unless defined?(Gem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Rubygems does not need to be required in a Gemspec. It's already loaded out of the box in Ruby now.
require "rubygems" unless defined?(Gem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Rubygems does not need to be required in a Gemspec. It's already loaded out of the box in Ruby now.
RUBY

expect_correction("\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

it 'registers an offense when using powershell_out!' do
expect_offense(<<~RUBY)
powershell_out!('foo')
^^^^^^^^^^^^^^^^^^^^^^ Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
powershell_out!('foo')
^^^^^^^^^^^^^^^^^^^^^^ Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
RUBY
end

it 'registers an offense when using powershell_out' do
expect_offense(<<~RUBY)
powershell_out('foo')
^^^^^^^^^^^^^^^^^^^^^ Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
powershell_out('foo')
^^^^^^^^^^^^^^^^^^^^^ Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
RUBY
end

Expand Down
8 changes: 4 additions & 4 deletions spec/rubocop/cop/chef/ruby/require_net_https_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

it 'registers an offense when when requiring net/https' do
expect_offense(<<~RUBY)
require 'net/https'
^^^^^^^^^^^^^^^^^^^ net/https is deprecated and just includes net/http and openssl. We should include those directly instead.
require 'net/https'
^^^^^^^^^^^^^^^^^^^ net/https is deprecated and just includes net/http and openssl. We should include those directly instead.
RUBY

expect_correction(<<~RUBY)
require "net/http"
require "openssl"
require "net/http"
require "openssl"
RUBY
end

Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/chef/ruby/unless_defined_require_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
context 'with a require known to the cop' do
it 'registers an offense without an if defined? check' do
expect_offense(<<~RUBY)
require 'digest/md5'
^^^^^^^^^^^^^^^^^^^^ Workaround rubygems slow requires by only running require if the class isn't already defined
require 'digest/md5'
^^^^^^^^^^^^^^^^^^^^ Workaround rubygems slow requires by only running require if the class isn't already defined
RUBY

expect_correction("require 'digest/md5' unless defined?(Digest::MD5)\n")
Expand Down

0 comments on commit e4620f9

Please sign in to comment.