test/helper.rb in nanoc-3.4.2 vs test/helper.rb in nanoc-3.4.3
- old
+ new
@@ -6,11 +6,11 @@
# Load unit testing stuff
begin
require 'minitest/unit'
require 'minitest/spec'
require 'minitest/mock'
- require 'mocha'
+ require 'mocha/setup'
rescue => e
$stderr.puts "To run the nanoc unit tests, you need minitest and mocha."
raise e
end
@@ -117,10 +117,11 @@
$stderr = StringIO.new
end
# Enter tmp
FileUtils.mkdir_p('tmp')
+ @orig_wd = FileUtils.pwd
FileUtils.cd('tmp')
# Let us get to the raw errors
Nanoc::CLI::ErrorHandler.disable
end
@@ -128,10 +129,10 @@
def teardown
# Restore normal error handling
Nanoc::CLI::ErrorHandler.enable
# Exit tmp
- FileUtils.cd('..')
+ FileUtils.cd(@orig_wd)
FileUtils.rm_rf('tmp')
# Go unquiet
unless ENV['QUIET'] == 'false'
$stdout = STDOUT