public
Created

Heckle with different ruby2ruby versions

  • Download Gist
1.2.2-output.log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
☹ bundle update
Fetching gem metadata from http://rubygems.org/.......
Using ZenTest (4.8.1)
Using RubyInline (3.9.0)
Using sexp_processor (3.2.0)
Using ParseTree (3.0.9)
Using ruby2ruby (1.2.2)
Using heckle (1.4.3)
Using bundler (1.1.4)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
 
☺ bundle exec heckle Greeter
Timeout set to 5 seconds.
Initial tests pass. Let's rumble.
 
**********************************************************************
*** Greeter#greet loaded with 7 possible mutations
**********************************************************************
 
7 mutations remaining...
6 mutations remaining...
5 mutations remaining...
4 mutations remaining...
3 mutations remaining...
2 mutations remaining...
1 mutations remaining...
 
The following mutations didn't cause test failures:
 
--- original
+++ mutation
def greet
- raise("here") if (rand > 1)
+ raise("here") if (rand > 12)
"Hi #{@person}!"
end
 
--- original
+++ mutation
def greet
- raise("here") if (rand > 1)
+ raise("here") if nil
"Hi #{@person}!"
end
 
--- original
+++ mutation
def greet
- raise("here") if (rand > 1)
+ if (rand > 1) then
+ raise("\0349=\020xl5$\eA$\bM,Rh:7\bg00?#\v\025\016F$& V<\01780\020`\e(FYQ\023IK")
+ end
"Hi #{@person}!"
end
 
--- original
+++ mutation
def greet
- raise("here") if (rand > 1)
+ nil if (rand > 1)
"Hi #{@person}!"
end
 
Heckle Results:
 
Passed : 0
Failed : 1
Thick Skin: 0
 
Improve the tests and try again.
1.3.1-output.log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
☹ bundle update
Fetching gem metadata from http://rubygems.org/.......
Using ZenTest (4.8.1)
Using RubyInline (3.9.0)
Using sexp_processor (3.2.0)
Using ParseTree (3.0.9)
Using ruby_parser (2.3.1)
Using ruby2ruby (1.3.1)
Using heckle (1.4.3)
Using bundler (1.1.4)
 
☺ bundle exec heckle Greeter
Timeout set to 5 seconds.
Initial tests pass. Let's rumble.
 
**********************************************************************
*** Greeter#greet loaded with 7 possible mutations
**********************************************************************
 
7 mutations remaining...
6 mutations remaining...
/Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/heckle.rb:603:in `current_code': undefined method `translate' for Ruby2Ruby:Class (NoMethodError)
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/heckle.rb:202:in `record_passing_mutation'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/heckle.rb:149:in `run_tests'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/heckle.rb:173:in `validate'
from /Users/moonglum/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/timeout.rb:67:in `timeout'
from /Users/moonglum/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/timeout.rb:101:in `timeout'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/heckle.rb:173:in `validate'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/test_unit_heckler.rb:80:in `validate'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/test_unit_heckler.rb:79:in `each'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/../lib/test_unit_heckler.rb:79:in `validate'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/gems/heckle-1.4.3/bin/heckle:95
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/bin/heckle:19:in `load'
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/bin/heckle:19
from /Users/moonglum/.rvm/gems/ruby-1.8.7-p358@heckling/bin/ruby_noexec_wrapper:14
greeter.rb
Ruby
1 2 3 4 5 6 7 8 9 10
class Greeter
def initialize(person)
@person = person
end
def greet
if rand > 1; raise 'here' end
"Hi #{@person}!"
end
end
test_greeter.rb
Ruby
1 2 3 4 5 6 7 8 9
require "test/unit"
require "./lib/greeter.rb"
 
class TestGreeter < Test::Unit::TestCase
def test_greet
@greeter = Greeter.new('Lucas')
assert_equal 'Hi Lucas!', @greeter.greet
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.