Sha256: c06c9e9b0cfc5af48394e05f0c7a02461f9f54f257716481d5e8b98b09c67f0c

Contents?: true

Size: 605 Bytes

Versions: 6

Compression:

Stored size: 605 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
      assert_kind_of Integer, t

      u = RubyProf.measure_allocations
      assert u > t, [t, u].inspect
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-prof-0.15.8 test/measure_allocations_test.rb
ruby-prof-0.15.7 test/measure_allocations_test.rb
ruby-prof-0.15.6 test/measure_allocations_test.rb
ruby-prof-0.15.5 test/measure_allocations_test.rb
ruby-prof-0.15.4 test/measure_allocations_test.rb
ruby-prof-0.15.3 test/measure_allocations_test.rb