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