Sha256: a314c03b2a15479ab8768cb877f7ecf0a83b02fefdc2e42c67843fb48108bba8

Contents?: true

Size: 573 Bytes

Versions: 54

Compression:

Stored size: 573 Bytes

Contents

require 'test_helper'

$outside = __callee__
def fred 
  "I'm in #{__callee__.inspect}" 
end 

class KernelTest < Test::Unit::TestCase
  context "Kernel" do
    context ".loop" do
      should "catch StopIteration" do
        i = 0
        r = []
        loop do 
          r << i
          i += 1
          raise StopIteration if i > 2
        end
        assert_equal [0, 1, 2], r
      end
    end
    

    context ".__callee__" do
      should "conform to doc" do
        assert_equal "I'm in :fred", fred
        assert_equal nil, $outside
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
marcandre-backports-1.7.0 test/kernel_test.rb
marcandre-backports-1.7.1 test/kernel_test.rb
marcandre-backports-1.8.0 test/kernel_test.rb
marcandre-backports-1.8.1 test/kernel_test.rb
marcandre-backports-1.8.2 test/kernel_test.rb
marcandre-backports-1.8.3 test/kernel_test.rb
marcandre-backports-1.8.4 test/kernel_test.rb
marcandre-backports-1.9.0 test/kernel_test.rb
backports-2.3.0 test/kernel_test.rb
backports-2.2.1 test/kernel_test.rb
backports-2.2.0 test/kernel_test.rb
backports-2.1.0 test/kernel_test.rb
backports-2.0.3 test/kernel_test.rb
backports-2.0.2 test/kernel_test.rb
backports-2.0.1 test/kernel_test.rb
backports-2.0.0 test/kernel_test.rb
backports-1.18.2 test/kernel_test.rb
backports-1.18.1 test/kernel_test.rb
backports-1.18.0 test/kernel_test.rb
backports-1.17.1 test/kernel_test.rb