Sha256: 1f909f71ea28e67eb3fb6a651efe97f1aba799b2838b19ace0545b8252897410

Contents?: true

Size: 846 Bytes

Versions: 20

Compression:

Stored size: 846 Bytes

Contents

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

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

class BasicTest < 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_raises(RuntimeError) do
      RubyProf.start
    end
    RubyProf.stop
  end

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

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

    RubyProf.stop
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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