examples/coverage/test.rb in covered-0.11.0 vs examples/coverage/test.rb in covered-0.12.0
- old
+ new
@@ -1,8 +1,16 @@
+trace_point = TracePoint.new(:call, :return, :line, :c_call, :c_return, :b_call, :b_return) do |trace|
+ puts [trace.path, trace.lineno].join(":")
+end
-puts "Hello World"
+trace_point.enable
-all_the_things = []
+values = {foo: 10}
-if all_the_things.any?
- puts "I've got all the things"
+def shell_escape(x)
+ x
end
+
+values.map{|key, value| [
+ key.to_s.upcase,
+ shell_escape(value) # TracePoint is never triggered for this line.
+]}