summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--test/ruby/test_require.rb13
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 12c2885..8475b67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Aug 7 11:58:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * test/ruby/test_require.rb (TestRequire#test_require_twice): added.
+
Tue Aug 7 11:35:37 2012 Shugo Maeda <shugo@ruby-lang.org>
* vm_method.c (rb_redefine_opt_method): use RCLASS_ORIGIN to avoid
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 58cf241..9286994 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -105,6 +105,19 @@ class TestRequire < Test::Unit::TestCase
assert(system(File.expand_path(EnvUtil.rubybin).sub(/\A(\w):/, '//127.0.0.1/\1$/'), "-rabbrev", "-e0"))
end if /mswin|mingw/ =~ RUBY_PLATFORM
+ def test_require_twice
+ Dir.mktmpdir do |tmp|
+ req = File.join(tmp, "very_long_file_name.rb")
+ File.write(req, "p :ok\n")
+ assert(File.exist?(req))
+ req[/.rb$/i] = ""
+ assert_in_out_err(['--disable-gems'], <<-INPUT, %w(:ok), [])
+ require "#{req}"
+ require "#{req}"
+ INPUT
+ end
+ end
+
def test_define_class
begin
require "socket"