Skip to content

Commit

Permalink
Merge pull request mbj#739 from michaelherold/fix-to-i-to-implicit-self
Browse files Browse the repository at this point in the history
Stop mutation of `#to_i` to implicit `self`
  • Loading branch information
mbj authored Jun 17, 2018
2 parents 2beac2c + f6b9b8b commit 3eb5527
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
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: 1321
total_score: 1316
2 changes: 1 addition & 1 deletion lib/mutant/mutator/node/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def emit_drop_mutation
#
# @return [undefined]
def emit_integer_mutation
return unless selector.equal?(:to_i)
return unless receiver && selector.equal?(:to_i)

emit(s(:send, nil, :Integer, receiver))
end
Expand Down
7 changes: 7 additions & 0 deletions meta/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@
mutation 'map'
end

Mutant::Meta::Example.add :send do
source 'to_i'

singleton_mutations
mutation 'to_int'
end

Mutant::Meta::Example.add :send do
source 'foo.to_s'

Expand Down

0 comments on commit 3eb5527

Please sign in to comment.