Sha256: d9b22229e44e9b8eb89199b54ee04c8d62f2d3556ee0a65a7984157f646e159c

Contents?: true

Size: 587 Bytes

Versions: 13

Compression:

Stored size: 587 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require File.expand_path('../test_helper', __FILE__)

# --  Test for bug
# http://github.com/rdp/ruby-prof/issues#issue/12

class EnumerableTest < TestCase
  def test_enumerable
    result = RubyProf.profile do
      3.times {  [1,2,3].any? {|n| n} }
    end
    methods = if RUBY_VERSION >= "2.2.0"
      %w(EnumerableTest#test_enumerable Integer#times Array#any?)
    else
      %w(EnumerableTest#test_enumerable Integer#times Enumerable#any? Array#each)
    end
    assert_equal(methods, result.threads.first.methods.map(&:full_name))
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
ruby-prof-0.17.0 test/enumerable_test.rb
airbnb-ruby-prof-0.0.1 test/enumerable_test.rb
ruby-prof-0.16.2 test/enumerable_test.rb
ruby-prof-0.16.1 test/enumerable_test.rb
ruby-prof-0.16.0 test/enumerable_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/ruby-prof-0.15.9/test/enumerable_test.rb
ruby-prof-0.15.9 test/enumerable_test.rb
ruby-prof-0.15.8 test/enumerable_test.rb
ruby-prof-0.15.7 test/enumerable_test.rb
ruby-prof-0.15.6 test/enumerable_test.rb
ruby-prof-0.15.5 test/enumerable_test.rb
ruby-prof-0.15.4 test/enumerable_test.rb
ruby-prof-0.15.3 test/enumerable_test.rb