Refactor run mutate #1

Merged
merged 2 commits into from Feb 23, 2012
Jump to file
+51 −45
View
2 spec/functional/class_spec.rb
@@ -36,7 +36,7 @@ def alphabet_range; 'a'..'k' end
end
end
"""
- run_simple '../../bin/mutate Thing spec/thing_spec.rb'
+ mutate 'Thing spec/thing_spec.rb'
end
it 'runs all possible mutations' do
View
4 spec/functional/instance_method/array_spec.rb
@@ -22,7 +22,7 @@ def to_a
specify { Thing.new.to_a.should eq([1,2,3]) }
end
"""
- run_simple '../../bin/mutate Thing#to_a spec/thing_spec.rb'
+ mutate 'Thing#to_a spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def to_a
specify { Thing.new.to_a.should respond_to(:length) }
end
"""
- run_simple '../../bin/mutate Thing#to_a spec/thing_spec.rb'
+ mutate 'Thing#to_a spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
8 spec/functional/instance_method/boolean_spec.rb
@@ -22,7 +22,7 @@ def alive?
specify { Thing.new.should be_alive }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def alive?
specify { String(Thing.new.alive?).should =~ /true|false/ }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
specify 'the mutation fails' do
@@ -68,7 +68,7 @@ def alive?
specify { Thing.new.should_not be_alive }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -85,7 +85,7 @@ def alive?
specify { String(Thing.new.alive?).should =~ /true|false/ }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/fixnum_spec.rb
@@ -22,7 +22,7 @@ def answer
specify { Life.new.answer.should eq(42) }
end
"""
- run_simple '../../bin/mutate Life#answer spec/life_spec.rb'
+ mutate 'Life#answer spec/life_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def answer
specify { Life.new.answer.should be_a(Fixnum) }
end
"""
- run_simple '../../bin/mutate Life#answer spec/life_spec.rb'
+ mutate 'Life#answer spec/life_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/float_spec.rb
@@ -22,7 +22,7 @@ def answer
specify { Life.new.answer.should eq(42.5) }
end
"""
- run_simple '../../bin/mutate Life#answer spec/life_spec.rb'
+ mutate 'Life#answer spec/life_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def answer
specify { Life.new.answer.should be_a(Float) }
end
"""
- run_simple '../../bin/mutate Life#answer spec/life_spec.rb'
+ mutate 'Life#answer spec/life_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/hash_spec.rb
@@ -22,7 +22,7 @@ def to_hash
specify { Thing.new.to_hash[:foo][:bar].should eq(3) }
end
"""
- run_simple '../../bin/mutate Thing#to_hash spec/thing_spec.rb'
+ mutate 'Thing#to_hash spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def to_hash
specify { Thing.new.to_hash[:foo][:bar].should be_kind_of(Fixnum) }
end
"""
- run_simple '../../bin/mutate Thing#to_hash spec/thing_spec.rb'
+ mutate 'Thing#to_hash spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/range_spec.rb
@@ -22,7 +22,7 @@ def a_range
specify { Thing.new.a_range.should eq('a'..'z') }
end
"""
- run_simple '../../bin/mutate Thing#a_range spec/thing_spec.rb'
+ mutate 'Thing#a_range spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def a_range
specify { Thing.new.a_range.should be_a(Range) }
end
"""
- run_simple '../../bin/mutate Thing#a_range spec/thing_spec.rb'
+ mutate 'Thing#a_range spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/regex_spec.rb
@@ -24,7 +24,7 @@ def regex
end
end
"""
- run_simple '../../bin/mutate Thing#regex spec/thing_spec.rb'
+ mutate 'Thing#regex spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -41,7 +41,7 @@ def regex
specify { Thing.new.regex.should be_kind_of(Regexp) }
end
"""
- run_simple '../../bin/mutate Thing#regex spec/thing_spec.rb'
+ mutate 'Thing#regex spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/string_spec.rb
@@ -22,7 +22,7 @@ def a_string
specify { Thing.new.a_string.should eq('foo') }
end
"""
- run_simple '../../bin/mutate Thing#a_string spec/thing_spec.rb'
+ mutate 'Thing#a_string spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def a_string
specify { Thing.new.a_string.should be_a(String) }
end
"""
- run_simple '../../bin/mutate Thing#a_string spec/thing_spec.rb'
+ mutate 'Thing#a_string spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/instance_method/symbol_spec.rb
@@ -22,7 +22,7 @@ def a_symbol
specify { Thing.new.a_symbol.should eq(:foo) }
end
"""
- run_simple '../../bin/mutate Thing#a_symbol spec/thing_spec.rb'
+ mutate 'Thing#a_symbol spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def a_symbol
specify { Thing.new.a_symbol.should be_a(Symbol) }
end
"""
- run_simple '../../bin/mutate Thing#a_symbol spec/thing_spec.rb'
+ mutate 'Thing#a_symbol spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/reporter/method_loaded_spec.rb
@@ -18,7 +18,7 @@ def alive?
specify { Thing.new.should be_alive }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
it 'displays the number of possible mutations' do
@@ -45,7 +45,7 @@ def alive?
specify { Thing.new.alive?.should be_nil }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
it 'displays a warning that there are no possible mutations' do
View
2 spec/functional/reporter/running_mutations_spec.rb
@@ -27,7 +27,7 @@ def alive?
ENV['RANDOM_RANGE_MIN'] = '1'
ENV['RANDOM_RANGE_MAX'] = '3'
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb'
+ mutate 'Thing#alive? spec/thing_spec.rb'
end
after do
View
2 spec/functional/runners/rspec_spec.rb
@@ -13,7 +13,7 @@ def alive?; true end
specify { Thing.new.should_not be_alive }
end
"""
- run_simple '../../bin/mutate Thing#alive? spec/thing_spec.rb', false
+ mutate 'Thing#alive? spec/thing_spec.rb', false
end
it 'causes the run to abort' do
View
4 spec/functional/singleton_method/array_spec.rb
@@ -22,7 +22,7 @@ def self.to_a
specify { Thing.to_a.should eq([1,2,3]) }
end
"""
- run_simple '../../bin/mutate Thing.to_a spec/thing_spec.rb'
+ mutate 'Thing.to_a spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.to_a
specify { Thing.to_a.should respond_to(:length) }
end
"""
- run_simple '../../bin/mutate Thing.to_a spec/thing_spec.rb'
+ mutate 'Thing.to_a spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
8 spec/functional/singleton_method/boolean_spec.rb
@@ -22,7 +22,7 @@ def self.alive?
specify { Thing.should be_alive }
end
"""
- run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb'
+ mutate 'Thing.alive? spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.alive?
specify { String(Thing.alive?).should =~ /true|false/ }
end
"""
- run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb'
+ mutate 'Thing.alive? spec/thing_spec.rb'
end
specify 'the mutation fails' do
@@ -68,7 +68,7 @@ def self.alive?
specify { Thing.should_not be_alive }
end
"""
- run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb'
+ mutate 'Thing.alive? spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -85,7 +85,7 @@ def self.alive?
specify { String(Thing.alive?).should =~ /true|false/ }
end
"""
- run_simple '../../bin/mutate Thing.alive? spec/thing_spec.rb'
+ mutate 'Thing.alive? spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/fixnum_spec.rb
@@ -22,7 +22,7 @@ def self.answer
specify { Life.answer.should eq(42) }
end
"""
- run_simple '../../bin/mutate Life.answer spec/life_spec.rb'
+ mutate 'Life.answer spec/life_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.answer
specify { Life.answer.should be_a(Fixnum) }
end
"""
- run_simple '../../bin/mutate Life.answer spec/life_spec.rb'
+ mutate 'Life.answer spec/life_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/float_spec.rb
@@ -22,7 +22,7 @@ def self.answer
specify { Life.answer.should eq(42.05) }
end
"""
- run_simple '../../bin/mutate Life.answer spec/life_spec.rb'
+ mutate 'Life.answer spec/life_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.answer
specify { Life.answer.should be_a(Float) }
end
"""
- run_simple '../../bin/mutate Life.answer spec/life_spec.rb'
+ mutate 'Life.answer spec/life_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/hash_spec.rb
@@ -22,7 +22,7 @@ def self.to_hash
specify { Thing.to_hash[:foo][:bar].should eq(3) }
end
"""
- run_simple '../../bin/mutate Thing.to_hash spec/thing_spec.rb'
+ mutate 'Thing.to_hash spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.to_hash
specify { Thing.to_hash[:foo][:bar].should be_kind_of(Fixnum) }
end
"""
- run_simple '../../bin/mutate Thing.to_hash spec/thing_spec.rb'
+ mutate 'Thing.to_hash spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/range_spec.rb
@@ -22,7 +22,7 @@ def self.a_range
specify { Thing.a_range.should eq('a'..'z') }
end
"""
- run_simple '../../bin/mutate Thing.a_range spec/thing_spec.rb'
+ mutate 'Thing.a_range spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.a_range
specify { Thing.a_range.should be_a(Range) }
end
"""
- run_simple '../../bin/mutate Thing.a_range spec/thing_spec.rb'
+ mutate 'Thing.a_range spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/regex_spec.rb
@@ -24,7 +24,7 @@ def self.regex
end
end
"""
- run_simple '../../bin/mutate Thing.regex spec/thing_spec.rb'
+ mutate 'Thing.regex spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -41,7 +41,7 @@ def self.regex
specify { Thing.regex.should be_kind_of(Regexp) }
end
"""
- run_simple '../../bin/mutate Thing.regex spec/thing_spec.rb'
+ mutate 'Thing.regex spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/string_spec.rb
@@ -22,7 +22,7 @@ def self.a_string
specify { Thing.a_string.should eq('foo') }
end
"""
- run_simple '../../bin/mutate Thing.a_string spec/thing_spec.rb'
+ mutate 'Thing.a_string spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.a_string
specify { Thing.a_string.should be_a(String) }
end
"""
- run_simple '../../bin/mutate Thing.a_string spec/thing_spec.rb'
+ mutate 'Thing.a_string spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
4 spec/functional/singleton_method/symbol_spec.rb
@@ -22,7 +22,7 @@ def self.a_symbol
specify { Thing.a_symbol.should eq(:foo) }
end
"""
- run_simple '../../bin/mutate Thing.a_symbol spec/thing_spec.rb'
+ mutate 'Thing.a_symbol spec/thing_spec.rb'
end
specify 'the mutation passes' do
@@ -39,7 +39,7 @@ def self.a_symbol
specify { Thing.a_symbol.should be_a(Symbol) }
end
"""
- run_simple '../../bin/mutate Thing.a_symbol spec/thing_spec.rb'
+ mutate 'Thing.a_symbol spec/thing_spec.rb'
end
specify 'the mutation fails' do
View
1 spec/spec_helper.rb
@@ -8,6 +8,7 @@
config.filter_run :focus
config.run_all_when_everything_filtered = true
config.extend ExampleGroupHelpers
+ config.include ExampleHelpers
{:example_group => {:file_path => /spec\/functional/}}.tap do |options|
config.include Aruba::Api, options
View
5 spec/support/example_helpers.rb
@@ -0,0 +1,5 @@
+module ExampleHelpers
+ def mutate(cmd, fail_on_error = true)
+ run_simple "../../exe/mutate #{cmd}", fail_on_error
+ end
+end