Sha256: 793a7494a392cbc7053f822cfd518752116bdd5a5f38c5fe92f66250177c85ae

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'ruby-prof'
require 'test_helper'


module Foo
  def Foo::hello
  end
end

module Bar
  def Bar::hello
    Foo::hello
  end
  
  def hello
    Bar::hello
  end
end

include Bar

class BasicTest < Test::Unit::TestCase
  def test_nested_modules
		result = RubyProf.profile do
			hello
		end

		methods = result.threads.values.first
	    
  	# Length should be 4s
  	assert_equal(4, methods.length)
    
  	method1 = methods['Bar#hello']
  	assert_not_nil(method1)
  	
  	method1 = methods['<Module::Bar>#hello']
  	assert_not_nil(method1)
  	
  	method1 = methods['<Module::Foo>#hello']
  	assert_not_nil(method1)
	end	
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-prof-0.4.0-mswin32 test/module_test.rb
ruby-prof-0.4.0 test/module_test.rb