File: no_method_class_test.rb

package info (click to toggle)
ruby-prof 0.6.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 412 kB
  • ctags: 343
  • sloc: ruby: 1,669; ansic: 1,138; makefile: 29
file content (14 lines) | stat: -rwxr-xr-x 333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env ruby

require 'ruby-prof'

# Make sure this works with no class or method
result = RubyProf.profile do 
  sleep 1
end

method = result.threads.values.first.sort.last

if method.full_name != 'Global#[No method]'
  raise(RuntimeError, "Wrong method name.  Expected: Global#[No method].  Actual: #{method.full_name}")
end