Sha256: d167e3ae5768422f4489aa674587267e266c99e06b7f4a5bbd320fd367af9911

Contents?: true

Size: 776 Bytes

Versions: 6

Compression:

Stored size: 776 Bytes

Contents

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

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

class BasicTest < Test::Unit::TestCase
  def setup
    # Need to use wall time for this test due to the sleep calls
    RubyProf::measure_mode = RubyProf::WALL_TIME
  end

  def test_running
    assert(!RubyProf.running?)
    RubyProf.start
    assert(RubyProf.running?)
    RubyProf.stop
    assert(!RubyProf.running?)
  end

  def test_double_profile
    RubyProf.start
    assert_raise(RuntimeError) do
      RubyProf.start
    end
    RubyProf.stop
  end

  def test_no_block
    assert_raise(ArgumentError) do
      RubyProf.profile
    end
  end

  def test_traceback
    RubyProf.start
    assert_raise(NoMethodError) do
      RubyProf.xxx
    end

    RubyProf.stop
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-prof-0.11.0.rc3-x86-mingw32 test/basic_test.rb
ruby-prof-0.11.0.rc3 test/basic_test.rb
ruby-prof-0.11.0.rc2-x86-mingw32 test/basic_test.rb
ruby-prof-0.11.0.rc2 test/basic_test.rb
ruby-prof-0.11.0.rc1-x86-mingw32 test/basic_test.rb
ruby-prof-0.11.0.rc1 test/basic_test.rb