Skip to content

Commit

Permalink
Merge pull request #6742 from bquorning/increase-code-coverage
Browse files Browse the repository at this point in the history
Increase code coverage
  • Loading branch information
Drenmi committed Feb 7, 2019
2 parents 2269afc + 65fed37 commit 1c8335c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
12 changes: 0 additions & 12 deletions lib/rubocop/cop/layout/closing_heredoc_indentation.rb
Expand Up @@ -74,10 +74,6 @@ def opening_indentation(node)
indent_level(heredoc_opening(node))
end

def empty_heredoc?(node)
node.loc.heredoc_body.source.empty? || !contents_indentation(node)
end

def argument_indentation_correct?(node)
return unless node.argument? || node.chained?

Expand All @@ -86,14 +82,6 @@ def argument_indentation_correct?(node)
) == closing_indentation(node)
end

def contents_indentation(node)
source_lines = node.loc.heredoc_body.source.split("\n")

source_lines.reject(&:empty?).map do |line|
indent_level(line)
end.min
end

def closing_indentation(node)
indent_level(heredoc_closing(node))
end
Expand Down
5 changes: 0 additions & 5 deletions lib/rubocop/cop/style/yoda_condition.rb
Expand Up @@ -97,11 +97,6 @@ def yoda_compatible_condition?(node)
!noncommutative_operator?(node)
end

def both_literals?(node)
lhs, _operator, rhs = *node
lhs.literal? && rhs.literal?
end

def valid_yoda?(node)
lhs, _operator, rhs = *node

Expand Down
4 changes: 3 additions & 1 deletion spec/rubocop/cop/lint/implicit_string_concatenation_spec.rb
Expand Up @@ -14,6 +14,8 @@
expect_offense(<<-RUBY.strip_indent)
class A; "abc" "def"; end
^^^^^^^^^^^ Combine "abc" and "def" into a single string literal, rather than using implicit string concatenation.
class B; 'ghi' 'jkl'; end
^^^^^^^^^^^ Combine 'ghi' and 'jkl' into a single string literal, rather than using implicit string concatenation.
RUBY
end
end
Expand All @@ -32,7 +34,7 @@ class A; "abc" "def"; end
context 'when the string literals contain newlines' do
it 'registers an offense' do
inspect_source(<<-RUBY.strip_indent)
def method; "ab\\nc" "de\\nf"; end
def method; "ab\nc" "de\nf"; end
RUBY

expect(cop.offenses.size).to eq(1)
Expand Down

0 comments on commit 1c8335c

Please sign in to comment.