Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Embedding
-
Labels:None
Description
When a script is loaded from classpath, File.dirname(_FILE_) returns the base directory. Because of this behavior, test_dir.rb test_file.rb test_io.rb, and test_load_class_before_rb.rb fail. For example, test_io.rb outputs:
[junit] [test_io.rb]
[junit] Loaded suite -
[junit] Started
[junit] test_io.rb:71 warning: syswrite for buffered IO
[junit] .........F...................
[junit] Finished in 0.435 seconds.
[junit]
[junit] 1) Failure:
[junit] test_io_reopen(TestIO) [test_io.rb:450]:
[junit] <"foo"> expected but was
[junit] <"Error opening script file: /Users/yoko/DevSpace/jruby~main/./quiet.rb (No such file or directory)">.
[junit]
[junit] 29 tests, 108 assertions, 1 failures, 0 errors
All of those test scripts work well without errors when those are read from absolute path.
This seems to be fixed on master.