Sha256: f01044ff0fb458e45dedaae015a85f1c5678632fabd2b747748df512e9533ff2

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 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 >= "3.3.0"
                %w(EnumerableTest#test_enumerable Integer#times Kernel#block_given? Integer#< Array#any? Integer#succ)
              else
                %w(EnumerableTest#test_enumerable Integer#times Array#any?)
              end
    assert_equal(methods, result.threads.first.methods.map(&:full_name))
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-prof-1.7.1-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.7.1 test/enumerable_test.rb
ruby-prof-1.7.0-x64-mingw-ucrt test/enumerable_test.rb
ruby-prof-1.7.0 test/enumerable_test.rb