Skip to content

Commit 2e16b91

Browse files
stephenebtobie
authored andcommitted
test: runner restores current dir
PDoc::Generators::Html::Website#render is using Dir.chdir to change to the :output dir and not restoring the current working dir. This new test fails.
1 parent ad5113b commit 2e16b91

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
*.gem
3+
output

test/unit/runner/basic_test.rb

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
2+
3+
class BasicTest < Test::Unit::TestCase
4+
5+
def test_restores_original_dir
6+
original_dir = Dir.pwd
7+
puts "*** #{original_dir}"
8+
PDoc::Runner.new("test/fixtures/ajax.js",
9+
:output => 'test/output',
10+
:templates => 'templates/html'
11+
).run
12+
assert_equal original_dir, Dir.pwd
13+
end
14+
end

0 commit comments

Comments
 (0)