Quick demo of the problem of resetting Ruby STDLIB's Coverage mid-way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On "ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]", but should be the same on all 1.9+ | |
require 'coverage' | |
Coverage.start | |
require './foo' | |
puts Coverage.result | |
# {"foo.rb"=>[1, 1, 0, nil, nil, 1, 0, nil, nil]} | |
Coverage.start | |
Foo.new.bar | |
puts Coverage.result | |
# {"foo.rb"=>[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def bar | |
:bar | |
end | |
def baz | |
:baz | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment