File: no_method_class_test.rb

package info (click to toggle)
ruby-prof 0.17.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,656 kB
  • sloc: ruby: 5,043; ansic: 2,175; makefile: 6
file content (15 lines) | stat: -rwxr-xr-x 449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env ruby
# encoding: UTF-8

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

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

methods = result.threads.first.methods
global_method = methods.sort_by {|method| method.full_name}.first
if global_method.full_name != 'Kernel#sleep'
  raise(RuntimeError, "Wrong method name.  Expected: Global#[No method].  Actual: #{global_method.full_name}")
end