Skip to content

Commit

Permalink
add tests for #2986
Browse files Browse the repository at this point in the history
Sponsored By Lookout Inc.
  • Loading branch information
mkristian committed May 26, 2015
1 parent 03c0a85 commit 52eb669
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/jruby.index
Expand Up @@ -39,6 +39,7 @@ jruby/test_integer_overflows
jruby/test_ivar_table_integrity
jruby/test_io
jruby/test_load
jruby/test_load_gem_extensions
jruby/test_method
jruby/test_method_cache
jruby/test_method_override_and_caching
Expand Down
32 changes: 32 additions & 0 deletions test/jruby/test_load_gem_extensions.rb
@@ -0,0 +1,32 @@
require 'test/unit'
require 'test/test_helper'
require 'rbconfig'
require 'jruby/path_helper'

class TestLoad < Test::Unit::TestCase
include TestHelper

def setup
@prev_loaded_features = $LOADED_FEATURES.dup
@prev_load_path = $LOAD_PATH.dup
end

def teardown
$LOADED_FEATURES.clear
$LOADED_FEATURES.concat(@prev_loaded_features)
$LOAD_PATH.clear
$LOAD_PATH.concat(@prev_load_path)
end

def test_require_extension_file_via_uri_protocol
require 'uri:file:./lib/ruby/shared/json/ext/parser'
# just check if extension class exists
JSON::Ext::Parser
end

def test_require_extension_file_via_uri_classloader_protocol
require 'uri:classloader:/lib/ruby/shared/json/ext/generator'
# just check if extension class exists
JSON::Ext::Generator
end
end

0 comments on commit 52eb669

Please sign in to comment.