Sha256: 6b0cf6f92244b3aad506c1a2caf9219025febdc6ea4b28a6a4ec4358bafae438

Contents?: true

Size: 608 Bytes

Versions: 26

Compression:

Stored size: 608 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

26 entries across 26 versions & 2 rubygems

Version Path
ruby-prof-1.5.0-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.5.0 test/enumerable_test.rb
ruby-prof-1.4.5-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.4.5 test/enumerable_test.rb
ruby-prof-1.4.4-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.4.4 test/enumerable_test.rb
ruby-prof-1.4.3-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.4.3 test/enumerable_test.rb
ruby-prof-1.4.2-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.4.2 test/enumerable_test.rb
ruby-prof-1.4.1-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.4.1 test/enumerable_test.rb
ruby-prof-1.4.0-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.4.0 test/enumerable_test.rb
ruby-prof-1.3.2 test/enumerable_test.rb
ruby-prof-1.3.1-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.3.1 test/enumerable_test.rb
ruby-prof-1.3.0-x64-mingw32 test/enumerable_test.rb
ruby-prof-1.3.0 test/enumerable_test.rb
ruby-prof-1.2.0 test/enumerable_test.rb