Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Refactor run mutate #1

Merged
merged 2 commits into from

2 participants

Dan Kubb Josep M. Bach
Dan Kubb

This change fixes the path to point to the new location of the mutate binary and wraps up the run_simple call in a mutant spec helper method.

Josep M. Bach
Owner

Thanks!

Josep M. Bach txus merged commit ca2e1c1 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 51 additions and 45 deletions.
  1. +1 −1  spec/functional/class_spec.rb
  2. +2 −2 spec/functional/instance_method/array_spec.rb
  3. +4 −4 spec/functional/instance_method/boolean_spec.rb
  4. +2 −2 spec/functional/instance_method/fixnum_spec.rb
  5. +2 −2 spec/functional/instance_method/float_spec.rb
  6. +2 −2 spec/functional/instance_method/hash_spec.rb
  7. +2 −2 spec/functional/instance_method/range_spec.rb
  8. +2 −2 spec/functional/instance_method/regex_spec.rb
  9. +2 −2 spec/functional/instance_method/string_spec.rb
  10. +2 −2 spec/functional/instance_method/symbol_spec.rb
  11. +2 −2 spec/functional/reporter/method_loaded_spec.rb
  12. +1 −1  spec/functional/reporter/running_mutations_spec.rb
  13. +1 −1  spec/functional/runners/rspec_spec.rb
  14. +2 −2 spec/functional/singleton_method/array_spec.rb
  15. +4 −4 spec/functional/singleton_method/boolean_spec.rb
  16. +2 −2 spec/functional/singleton_method/fixnum_spec.rb
  17. +2 −2 spec/functional/singleton_method/float_spec.rb
  18. +2 −2 spec/functional/singleton_method/hash_spec.rb
  19. +2 −2 spec/functional/singleton_method/range_spec.rb
  20. +2 −2 spec/functional/singleton_method/regex_spec.rb
  21. +2 −2 spec/functional/singleton_method/string_spec.rb
  22. +2 −2 spec/functional/singleton_method/symbol_spec.rb
  23. +1 −0  spec/spec_helper.rb
  24. +5 −0 spec/support/example_helpers.rb
2  spec/functional/class_spec.rb
View
@@ -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
4 spec/functional/instance_method/array_spec.rb
View
@@ -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
8 spec/functional/instance_method/boolean_spec.rb
View
@@ -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
4 spec/functional/instance_method/fixnum_spec.rb
View
@@ -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
4 spec/functional/instance_method/float_spec.rb
View
@@ -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
4 spec/functional/instance_method/hash_spec.rb
View
@@ -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
4 spec/functional/instance_method/range_spec.rb
View
@@ -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
4 spec/functional/instance_method/regex_spec.rb
View
@@ -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
4 spec/functional/instance_method/string_spec.rb
View
@@ -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
4 spec/functional/instance_method/symbol_spec.rb
View
@@ -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
4 spec/functional/reporter/method_loaded_spec.rb
View
@@ -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
2  spec/functional/reporter/running_mutations_spec.rb
View
@@ -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
2  spec/functional/runners/rspec_spec.rb
View
@@ -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
4 spec/functional/singleton_method/array_spec.rb
View
@@ -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
8 spec/functional/singleton_method/boolean_spec.rb
View
@@ -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
4 spec/functional/singleton_method/fixnum_spec.rb
View
@@ -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
4 spec/functional/singleton_method/float_spec.rb
View
@@ -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
4 spec/functional/singleton_method/hash_spec.rb
View
@@ -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
4 spec/functional/singleton_method/range_spec.rb
View
@@ -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
4 spec/functional/singleton_method/regex_spec.rb
View
@@ -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
4 spec/functional/singleton_method/string_spec.rb
View
@@ -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
4 spec/functional/singleton_method/symbol_spec.rb
View
@@ -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
1  spec/spec_helper.rb
View
@@ -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
5 spec/support/example_helpers.rb
View
@@ -0,0 +1,5 @@
+module ExampleHelpers
+ def mutate(cmd, fail_on_error = true)
+ run_simple "../../exe/mutate #{cmd}", fail_on_error
+ end
+end
Something went wrong with that request. Please try again.