Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ GIT
PATH
remote: .
specs:
mutest (0.8.12)
mutest (0.0.2)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.0)
Expand Down
2 changes: 1 addition & 1 deletion config/flay.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
threshold: 16
total_score: 1325
total_score: 1329
2 changes: 1 addition & 1 deletion lib/mutest/source_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def initialize(path, ast, comments)
# TODO: Support inline comment disable
def ignore?(node)
location = node.location
return false unless location.expression
return false unless location && location.expression

disable_lines.include?(location.line)
end
Expand Down
6 changes: 5 additions & 1 deletion spec/unit/mutest/source_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ def bar
end
end

it 'ignores nodes that do not have a location' do
it 'ignores nodes that do not have a line' do
_, bar_method = *ast
_, bar_method_args, = *bar_method

expect(source_file.ignore?(bar_method_args)).to be(false)
end

it 'ignores nodes that do not have a location' do
expect(source_file.ignore?(s(:custom))).to be(false)
end
end