Sha256: 38df73f3819b6964fa64d48b4e073c414a9919dbb627cdd87e16fe69818e8a29

Contents?: true

Size: 458 Bytes

Versions: 4

Compression:

Stored size: 458 Bytes

Contents

class TestCase
  def test
    case 1+1
    when 1, 3
      puts "NOT OKAY"
    when 2
      puts "OKAY"
    else
      puts "NOT OKAY"
    end

    p (Array === [])
    p (RuntimeError === RuntimeError.new)

    case 1
    when Fixnum 
      puts "OK"
    when 1
      puts "OK"
    end

    case 4
    when 0..3
      puts "NOT OKAY"
    when 1...4
      puts "NOT OKAY"
    when 2..4
      puts "OKAY"
    end
  end

  def self.main
    new.test
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
superchris-rubyjs-0.8.2 test/test_case.rb
rubyjs-0.7.1 test/test_case.rb
rubyjs-0.8.0 test/test_case.rb
rubyjs-0.7.0 test/test_case.rb