Sha256: b72cdae0b3151a88d635d04f3282ec82f3b278030ce01b102416b0697ab66d10

Contents?: true

Size: 617 Bytes

Versions: 8

Compression:

Stored size: 617 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.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

8 entries across 8 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/ruby-prof-1.6.3/test/enumerable_test.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/ruby-prof-1.6.3/test/enumerable_test.rb
ruby-prof-1.6.3-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.6.3 test/enumerable_test.rb
ruby-prof-1.6.2-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.6.2 test/enumerable_test.rb
ruby-prof-1.6.1 test/enumerable_test.rb
ruby-prof-1.6.1-x64-mingw-ucrt test/enumerable_test.rb