2015-12-16 05:07:31 +00:00
|
|
|
# frozen_string_literal: false
|
2013-12-08 04:05:59 +00:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
class TestRubyVM < Test::Unit::TestCase
|
|
|
|
def test_stat
|
|
|
|
assert_kind_of Hash, RubyVM.stat
|
2020-10-14 16:09:33 +09:00
|
|
|
assert_kind_of Integer, RubyVM.stat[:global_constant_state]
|
2013-12-08 04:05:59 +00:00
|
|
|
|
|
|
|
RubyVM.stat(stat = {})
|
|
|
|
assert_not_empty stat
|
2020-10-14 16:09:33 +09:00
|
|
|
assert_equal stat[:global_constant_state], RubyVM.stat(:global_constant_state)
|
2013-12-08 04:05:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_stat_unknown
|
|
|
|
assert_raise(ArgumentError){ RubyVM.stat(:unknown) }
|
2014-03-31 02:34:40 +00:00
|
|
|
assert_raise_with_message(ArgumentError, /\u{30eb 30d3 30fc}/) {RubyVM.stat(:"\u{30eb 30d3 30fc}")}
|
2013-12-08 04:05:59 +00:00
|
|
|
end
|
|
|
|
end
|