Skip to content
Browse files

Add test for JRUBY-3872 and JRUBY-4663.

  • Loading branch information...
1 parent 999c35e commit 30f643db6654fbbf81fdac9022a12545a7e59169 @headius headius committed Mar 25, 2010
Showing with 32 additions and 0 deletions.
  1. +1 −0 test/dir_with_plusses_+++/required.rb
  2. +1 −0 test/jruby_index
  3. +30 −0 test/test_dir_with_plusses.rb
View
1 test/dir_with_plusses_+++/required.rb
@@ -0,0 +1 @@
+$dir_with_plusses_FILE = File.expand_path(__FILE__)
View
1 test/jruby_index
@@ -120,3 +120,4 @@ test_ast_inspector
test_jarred_gems_with_spaces_in_directory
test_weak_drb_id_conv
test_kernel
+test_dir_with_plusses
View
30 test/test_dir_with_plusses.rb
@@ -0,0 +1,30 @@
+require 'test/unit'
+
+class TestDirWithPlusses < Test::Unit::TestCase
+ def test_loaded_FILE_in_dir_with_plusses
+ begin
+ load 'test/dir_with_plusses_+++/required.rb'
+ assert_equal(
+ File.join(File.dirname(File.expand_path(__FILE__)), 'dir_with_plusses_+++', 'required.rb'),
+ $dir_with_plusses_FILE
+ )
+ ensure
+ # reset global
+ $dir_with_plusses_FILE = nil
+ end
+ end
+
+ def test_required_FILE_in_dir_with_plusses
+ begin
+ require 'test/dir_with_plusses_+++/required.rb'
+ assert_equal(
+ File.join(File.dirname(File.expand_path(__FILE__)), 'dir_with_plusses_+++', 'required.rb'),
+ $dir_with_plusses_FILE
+ )
+ ensure
+ # remove entry from loaded features and reset global
+ $".pop
+ $dir_with_plusses_FILE = nil
+ end
+ end
+end

0 comments on commit 30f643d

Please sign in to comment.
Something went wrong with that request. Please try again.