Skip to content

Commit

Permalink
Use File.expand_path outside temp_dir
Browse files Browse the repository at this point in the history
According to circumstances, File.dirname(__FILE__) inside temp_dir
returns invalid path, so uses File.expand_path('..', __FILE__) outside
temp_dir instead of it.
  • Loading branch information
aycabta committed Nov 8, 2017
1 parent 4b28219 commit ef82462
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test_rdoc_rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@ def test_parse_file_binary
def test_parse_file_include_root
@rdoc.store = RDoc::Store.new

test_path = File.expand_path('..', __FILE__)
top_level = nil
temp_dir do |dir|
@rdoc.options.parse %W[--root #{File.dirname(__FILE__)}]
@rdoc.options.parse %W[--root #{test_path}]

open 'include.txt', 'w' do |io|
io.puts ':include: test.txt'
Expand Down

0 comments on commit ef82462

Please sign in to comment.