Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from dkubb/refactor_run_mutate
Browse files Browse the repository at this point in the history
Refactor run mutate
  • Loading branch information
Josep M. Bach committed Feb 23, 2012
2 parents a7bee73 + 190c48d commit ca2e1c1
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 45 deletions.
2 changes: 1 addition & 1 deletion spec/functional/class_spec.rb
Expand Up @@ -36,7 +36,7 @@ def alphabet_range; 'a'..'k' end
end end
end end
""" """
run_simple '../../bin/mutate Thing spec/thing_spec.rb' mutate 'Thing spec/thing_spec.rb'
end end


it 'runs all possible mutations' do it 'runs all possible mutations' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/array_spec.rb
Expand Up @@ -22,7 +22,7 @@ def to_a
specify { Thing.new.to_a.should eq([1,2,3]) } specify { Thing.new.to_a.should eq([1,2,3]) }
end end
""" """
run_simple '../../bin/mutate Thing#to_a spec/thing_spec.rb' mutate 'Thing#to_a spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def to_a
specify { Thing.new.to_a.should respond_to(:length) } specify { Thing.new.to_a.should respond_to(:length) }
end end
""" """
run_simple '../../bin/mutate Thing#to_a spec/thing_spec.rb' mutate 'Thing#to_a spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
8 changes: 4 additions & 4 deletions spec/functional/instance_method/boolean_spec.rb
Expand Up @@ -22,7 +22,7 @@ def alive?
specify { Thing.new.should be_alive } specify { Thing.new.should be_alive }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def alive?
specify { String(Thing.new.alive?).should =~ /true|false/ } specify { String(Thing.new.alive?).should =~ /true|false/ }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down Expand Up @@ -68,7 +68,7 @@ def alive?
specify { Thing.new.should_not be_alive } specify { Thing.new.should_not be_alive }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -85,7 +85,7 @@ def alive?
specify { String(Thing.new.alive?).should =~ /true|false/ } specify { String(Thing.new.alive?).should =~ /true|false/ }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/fixnum_spec.rb
Expand Up @@ -22,7 +22,7 @@ def answer
specify { Life.new.answer.should eq(42) } specify { Life.new.answer.should eq(42) }
end end
""" """
run_simple '../../bin/mutate Life#answer spec/life_spec.rb' mutate 'Life#answer spec/life_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def answer
specify { Life.new.answer.should be_a(Fixnum) } specify { Life.new.answer.should be_a(Fixnum) }
end end
""" """
run_simple '../../bin/mutate Life#answer spec/life_spec.rb' mutate 'Life#answer spec/life_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/float_spec.rb
Expand Up @@ -22,7 +22,7 @@ def answer
specify { Life.new.answer.should eq(42.5) } specify { Life.new.answer.should eq(42.5) }
end end
""" """
run_simple '../../bin/mutate Life#answer spec/life_spec.rb' mutate 'Life#answer spec/life_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def answer
specify { Life.new.answer.should be_a(Float) } specify { Life.new.answer.should be_a(Float) }
end end
""" """
run_simple '../../bin/mutate Life#answer spec/life_spec.rb' mutate 'Life#answer spec/life_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/hash_spec.rb
Expand Up @@ -22,7 +22,7 @@ def to_hash
specify { Thing.new.to_hash[:foo][:bar].should eq(3) } specify { Thing.new.to_hash[:foo][:bar].should eq(3) }
end end
""" """
run_simple '../../bin/mutate Thing#to_hash spec/thing_spec.rb' mutate 'Thing#to_hash spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def to_hash
specify { Thing.new.to_hash[:foo][:bar].should be_kind_of(Fixnum) } specify { Thing.new.to_hash[:foo][:bar].should be_kind_of(Fixnum) }
end end
""" """
run_simple '../../bin/mutate Thing#to_hash spec/thing_spec.rb' mutate 'Thing#to_hash spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/range_spec.rb
Expand Up @@ -22,7 +22,7 @@ def a_range
specify { Thing.new.a_range.should eq('a'..'z') } specify { Thing.new.a_range.should eq('a'..'z') }
end end
""" """
run_simple '../../bin/mutate Thing#a_range spec/thing_spec.rb' mutate 'Thing#a_range spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def a_range
specify { Thing.new.a_range.should be_a(Range) } specify { Thing.new.a_range.should be_a(Range) }
end end
""" """
run_simple '../../bin/mutate Thing#a_range spec/thing_spec.rb' mutate 'Thing#a_range spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/regex_spec.rb
Expand Up @@ -24,7 +24,7 @@ def regex
end end
end end
""" """
run_simple '../../bin/mutate Thing#regex spec/thing_spec.rb' mutate 'Thing#regex spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -41,7 +41,7 @@ def regex
specify { Thing.new.regex.should be_kind_of(Regexp) } specify { Thing.new.regex.should be_kind_of(Regexp) }
end end
""" """
run_simple '../../bin/mutate Thing#regex spec/thing_spec.rb' mutate 'Thing#regex spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/string_spec.rb
Expand Up @@ -22,7 +22,7 @@ def a_string
specify { Thing.new.a_string.should eq('foo') } specify { Thing.new.a_string.should eq('foo') }
end end
""" """
run_simple '../../bin/mutate Thing#a_string spec/thing_spec.rb' mutate 'Thing#a_string spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def a_string
specify { Thing.new.a_string.should be_a(String) } specify { Thing.new.a_string.should be_a(String) }
end end
""" """
run_simple '../../bin/mutate Thing#a_string spec/thing_spec.rb' mutate 'Thing#a_string spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/instance_method/symbol_spec.rb
Expand Up @@ -22,7 +22,7 @@ def a_symbol
specify { Thing.new.a_symbol.should eq(:foo) } specify { Thing.new.a_symbol.should eq(:foo) }
end end
""" """
run_simple '../../bin/mutate Thing#a_symbol spec/thing_spec.rb' mutate 'Thing#a_symbol spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def a_symbol
specify { Thing.new.a_symbol.should be_a(Symbol) } specify { Thing.new.a_symbol.should be_a(Symbol) }
end end
""" """
run_simple '../../bin/mutate Thing#a_symbol spec/thing_spec.rb' mutate 'Thing#a_symbol spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/reporter/method_loaded_spec.rb
Expand Up @@ -18,7 +18,7 @@ def alive?
specify { Thing.new.should be_alive } specify { Thing.new.should be_alive }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


it 'displays the number of possible mutations' do it 'displays the number of possible mutations' do
Expand All @@ -45,7 +45,7 @@ def alive?
specify { Thing.new.alive?.should be_nil } specify { Thing.new.alive?.should be_nil }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


it 'displays a warning that there are no possible mutations' do it 'displays a warning that there are no possible mutations' do
Expand Down
2 changes: 1 addition & 1 deletion spec/functional/reporter/running_mutations_spec.rb
Expand Up @@ -27,7 +27,7 @@ def alive?
ENV['RANDOM_RANGE_MIN'] = '1' ENV['RANDOM_RANGE_MIN'] = '1'
ENV['RANDOM_RANGE_MAX'] = '3' ENV['RANDOM_RANGE_MAX'] = '3'


run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb' mutate 'Thing#alive? spec/thing_spec.rb'
end end


after do after do
Expand Down
2 changes: 1 addition & 1 deletion spec/functional/runners/rspec_spec.rb
Expand Up @@ -13,7 +13,7 @@ def alive?; true end
specify { Thing.new.should_not be_alive } specify { Thing.new.should_not be_alive }
end end
""" """
run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb', false mutate 'Thing#alive? spec/thing_spec.rb', false
end end


it 'causes the run to abort' do it 'causes the run to abort' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/array_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.to_a
specify { Thing.to_a.should eq([1,2,3]) } specify { Thing.to_a.should eq([1,2,3]) }
end end
""" """
run_simple '../../bin/mutate Thing.to_a spec/thing_spec.rb' mutate 'Thing.to_a spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.to_a
specify { Thing.to_a.should respond_to(:length) } specify { Thing.to_a.should respond_to(:length) }
end end
""" """
run_simple '../../bin/mutate Thing.to_a spec/thing_spec.rb' mutate 'Thing.to_a spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
8 changes: 4 additions & 4 deletions spec/functional/singleton_method/boolean_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.alive?
specify { Thing.should be_alive } specify { Thing.should be_alive }
end end
""" """
run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb' mutate 'Thing.alive? spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.alive?
specify { String(Thing.alive?).should =~ /true|false/ } specify { String(Thing.alive?).should =~ /true|false/ }
end end
""" """
run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb' mutate 'Thing.alive? spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down Expand Up @@ -68,7 +68,7 @@ def self.alive?
specify { Thing.should_not be_alive } specify { Thing.should_not be_alive }
end end
""" """
run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb' mutate 'Thing.alive? spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -85,7 +85,7 @@ def self.alive?
specify { String(Thing.alive?).should =~ /true|false/ } specify { String(Thing.alive?).should =~ /true|false/ }
end end
""" """
run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb' mutate 'Thing.alive? spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/fixnum_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.answer
specify { Life.answer.should eq(42) } specify { Life.answer.should eq(42) }
end end
""" """
run_simple '../../bin/mutate Life.answer spec/life_spec.rb' mutate 'Life.answer spec/life_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.answer
specify { Life.answer.should be_a(Fixnum) } specify { Life.answer.should be_a(Fixnum) }
end end
""" """
run_simple '../../bin/mutate Life.answer spec/life_spec.rb' mutate 'Life.answer spec/life_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/float_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.answer
specify { Life.answer.should eq(42.05) } specify { Life.answer.should eq(42.05) }
end end
""" """
run_simple '../../bin/mutate Life.answer spec/life_spec.rb' mutate 'Life.answer spec/life_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.answer
specify { Life.answer.should be_a(Float) } specify { Life.answer.should be_a(Float) }
end end
""" """
run_simple '../../bin/mutate Life.answer spec/life_spec.rb' mutate 'Life.answer spec/life_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/hash_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.to_hash
specify { Thing.to_hash[:foo][:bar].should eq(3) } specify { Thing.to_hash[:foo][:bar].should eq(3) }
end end
""" """
run_simple '../../bin/mutate Thing.to_hash spec/thing_spec.rb' mutate 'Thing.to_hash spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.to_hash
specify { Thing.to_hash[:foo][:bar].should be_kind_of(Fixnum) } specify { Thing.to_hash[:foo][:bar].should be_kind_of(Fixnum) }
end end
""" """
run_simple '../../bin/mutate Thing.to_hash spec/thing_spec.rb' mutate 'Thing.to_hash spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/range_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.a_range
specify { Thing.a_range.should eq('a'..'z') } specify { Thing.a_range.should eq('a'..'z') }
end end
""" """
run_simple '../../bin/mutate Thing.a_range spec/thing_spec.rb' mutate 'Thing.a_range spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.a_range
specify { Thing.a_range.should be_a(Range) } specify { Thing.a_range.should be_a(Range) }
end end
""" """
run_simple '../../bin/mutate Thing.a_range spec/thing_spec.rb' mutate 'Thing.a_range spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/regex_spec.rb
Expand Up @@ -24,7 +24,7 @@ def self.regex
end end
end end
""" """
run_simple '../../bin/mutate Thing.regex spec/thing_spec.rb' mutate 'Thing.regex spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -41,7 +41,7 @@ def self.regex
specify { Thing.regex.should be_kind_of(Regexp) } specify { Thing.regex.should be_kind_of(Regexp) }
end end
""" """
run_simple '../../bin/mutate Thing.regex spec/thing_spec.rb' mutate 'Thing.regex spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down
4 changes: 2 additions & 2 deletions spec/functional/singleton_method/string_spec.rb
Expand Up @@ -22,7 +22,7 @@ def self.a_string
specify { Thing.a_string.should eq('foo') } specify { Thing.a_string.should eq('foo') }
end end
""" """
run_simple '../../bin/mutate Thing.a_string spec/thing_spec.rb' mutate 'Thing.a_string spec/thing_spec.rb'
end end


specify 'the mutation passes' do specify 'the mutation passes' do
Expand All @@ -39,7 +39,7 @@ def self.a_string
specify { Thing.a_string.should be_a(String) } specify { Thing.a_string.should be_a(String) }
end end
""" """
run_simple '../../bin/mutate Thing.a_string spec/thing_spec.rb' mutate 'Thing.a_string spec/thing_spec.rb'
end end


specify 'the mutation fails' do specify 'the mutation fails' do
Expand Down

0 comments on commit ca2e1c1

Please sign in to comment.