Sha256: af3f3c842085b696e4598aa8692cc313d3b0376d8983589c29984db3bb3ff7df

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

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

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

class MeasureAllocationsTest < TestCase
  def test_allocations_mode
    RubyProf::measure_mode = RubyProf::ALLOCATIONS
    assert_equal(RubyProf::ALLOCATIONS, RubyProf::measure_mode)
  end

  def test_allocations_enabled_defined
    assert(defined?(RubyProf::ALLOCATIONS_ENABLED))
  end

  if RubyProf::ALLOCATIONS_ENABLED
    def test_allocations
      t = RubyProf.measure_allocations
      refute_empty("a" + "b")
      u = RubyProf.measure_allocations
      assert_kind_of Integer, t
      assert_kind_of Integer, u
      assert_operator t, :<, u
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ruby-prof-0.17.0 test/measure_allocations_test.rb
airbnb-ruby-prof-0.0.1 test/measure_allocations_test.rb
ruby-prof-0.16.2 test/measure_allocations_test.rb
ruby-prof-0.16.1 test/measure_allocations_test.rb
ruby-prof-0.16.0 test/measure_allocations_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/ruby-prof-0.15.9/test/measure_allocations_test.rb
ruby-prof-0.15.9 test/measure_allocations_test.rb