test/unit/test_tracy.rb in stack_tracy-0.1.5 vs test/unit/test_tracy.rb in stack_tracy-0.1.6

- old
+ new

@@ -185,9 +185,27 @@ assert hash.delete(:nsec) assert hash.delete(:duration) hash.delete(:time) end } + + stack_tracy :only => "Kernel" do + "Doing something".tracy do + puts "testing" + end + end + file, line = __FILE__, __LINE__ - 3 + + assert_equal [ + {:event => "call", :file => string_file, :line => 2, :singleton => false, :object => "Doing something", :method => "tracy", :call => "\"Doing something\"", :depth => 0}, + {:event => "c-call", :file => file, :line => line, :singleton => false, :object => Kernel, :method => "puts" , :call => "Kernel#puts", :depth => 1} + ], StackTracy.select.collect{ |event_info| + event_info.to_hash.tap do |hash| + assert hash.delete(:nsec) + assert hash.delete(:duration) + hash.delete(:time) + end + } end it "should filter methods as expected" do stack_tracy do puts "testing" \ No newline at end of file