Permalink
Browse files

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.
  • Loading branch information...
1 parent ad5113b commit 2e16b91a3859aa0d795c5aa24bc4b5e836bd18dc @stepheneb stepheneb committed with Apr 6, 2010
Showing with 15 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +14 −0 test/unit/runner/basic_test.rb
View
@@ -1,2 +1,3 @@
.DS_Store
*.gem
+output
@@ -0,0 +1,14 @@
+require File.expand_path(File.join(File.dirname(__FILE__), "..", "parser_test_helper"))
+
+class BasicTest < Test::Unit::TestCase
+
+ def test_restores_original_dir
+ original_dir = Dir.pwd
+ puts "*** #{original_dir}"
+ PDoc::Runner.new("test/fixtures/ajax.js",
+ :output => 'test/output',
+ :templates => 'templates/html'
+ ).run
+ assert_equal original_dir, Dir.pwd
+ end
+end

0 comments on commit 2e16b91

Please sign in to comment.