Class: TestKernel
- Defined in:
- lib/innate/test/testkernel.rb
Instance Method Summary collapse
Instance Method Details
#test_each_caller ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/innate/test/testkernel.rb', line 18 def test_each_caller c = -1 each_caller do |file, line, method| # <- the below test wants the line number of this line c += 1 if c == 0 assert_equal File.(__FILE__), File.(file) assert_equal 20, line assert_equal 'test_each_caller', method end end assert_equal c, caller.length end |
#test_each_loaded_file ⇒ Object
11 12 13 14 15 16 |
# File 'lib/innate/test/testkernel.rb', line 11 def test_each_loaded_file c = $".to_cursor each_loaded_file do |f| assert_match Regexp.new(Regexp.escape(c.read1next)), f end end |
#test_find_in_path ⇒ Object
6 7 8 9 |
# File 'lib/innate/test/testkernel.rb', line 6 def test_find_in_path #this assumes that the lib exists in ..../site_ruby/innate/kernel.rb assert_equal File.('../kernel.rb').downcase, find_in_path('innate/kernel').downcase end |