Skip to content

Commit

Permalink
Merge pull request #1191 from mbj/remove-duplicate-meta-example
Browse files Browse the repository at this point in the history
  • Loading branch information
dgollahon authored Jan 3, 2021
2 parents 0d4f81e + c439b45 commit 8e9d51c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
10 changes: 0 additions & 10 deletions meta/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@
mutation 'foo'
end

Mutant::Meta::Example.add :block do
source 'foo { |a| }'

singleton_mutations
mutation 'foo { || }'
mutation 'foo { |a| raise }'
mutation 'foo { |_a| }'
mutation 'foo'
end

Mutant::Meta::Example.add :block do
source 'foo { bar(nil) }'

Expand Down
15 changes: 0 additions & 15 deletions meta/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,6 @@
mutation 'true'
end

Mutant::Meta::Example.add :send do
source 'foo.is_a?(bar)'

singleton_mutations
mutation 'foo'
mutation 'bar'
mutation 'foo.is_a?'
mutation 'foo.is_a?(nil)'
mutation 'foo.is_a?(self)'
mutation 'self.is_a?(bar)'
mutation 'foo.instance_of?(bar)'
mutation 'false'
mutation 'true'
end

Mutant::Meta::Example.add :send do
source 'foo.kind_of?(bar)'

Expand Down
8 changes: 8 additions & 0 deletions spec/unit/mutant/meta/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
end
end

it 'does not define any repeated examples' do
source_counts = described_class::ALL.each_with_object(Hash.new(0)) do |example, counts|
counts["#{example.location.path}:#{example.original_source}"] += 1
end

expect(source_counts.select { |_source, count| count > 1 }.keys).to eql([])
end

describe '#original_source_generated' do
subject { object.original_source_generated }

Expand Down

0 comments on commit 8e9d51c

Please sign in to comment.