diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
commit | be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/h2o/libh2o/deps/mruby-require/test/test.rb | |
parent | Initial commit. (diff) | |
download | netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip |
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/deps/mruby-require/test/test.rb')
-rw-r--r-- | web/server/h2o/libh2o/deps/mruby-require/test/test.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby-require/test/test.rb b/web/server/h2o/libh2o/deps/mruby-require/test/test.rb new file mode 100644 index 00000000..0886cabe --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby-require/test/test.rb @@ -0,0 +1,34 @@ +$" = [] # init + +assert "Kernel#_load_rb_str" do + assert_equal true, self.methods.include?(:_load_rb_str) + assert_equal false, Object.const_defined?(:LOAD_RB_STR_TEST) + _load_rb_str("LOAD_RB_STR_TEST = 1") + assert_equal true, Object.const_defined?(:LOAD_RB_STR_TEST) +end + +assert "$LOAD_PATH check" do + assert_equal Array, $LOAD_PATH.class +end + +assert '$" check' do + assert_equal [], $" +end + +assert('load - error check') do + assert_raise TypeError, "load(nil) should raise TypeError" do + load nil + end + assert_raise LoadError, "load('notfound') should raise LoadError" do + load 'notfound' + end +end + +assert('require - error check') do + assert_raise TypeError, "require(nil) should raise TypeError" do + require nil + end + assert_raise LoadError, "require('notfound') should raise LoadError" do + require "notfound" + end +end |