From 567a7952dd0a506b04e2e50a1ac29715bc48aa6d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 16 Jan 2017 16:25:09 -0500 Subject: [PATCH] test/helper: fix flaky plugin path test by initializing Configuration::DEFAULTS at start of tests If we do a Dir.chdir before Configuration::DEFAULTS is initialized, then its source and destination values will not be what we expect. We expect that Dir.pwd should stay as the root of the repo but there are some errant calls to Dir.chdir without a block that are still not yet cleaned up. --- test/helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/helper.rb b/test/helper.rb index 0c6935a0..fcbb7166 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -30,6 +30,11 @@ require "minitest/profile" require "rspec/mocks" require_relative "../lib/jekyll.rb" +# The default "source" and "destination" values depend on Dir.pwd, +# which changes when we use Dir.chdir without a block. Initialize +# it here so it has Dir.pwd = root of this repo. +Jekyll::Configuration::DEFAULTS + Jekyll.logger = Logger.new(StringIO.new) unless jruby?