From 2ef70fd34860e0c067117c5fdd587d6eb9b06664 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 28 Jun 2016 14:39:06 -0700 Subject: [PATCH] Some weird stuff with Colorator on my machine & jruby. --- test/test_configuration.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test_configuration.rb b/test/test_configuration.rb index eddb2c96..0e0a69c7 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -1,4 +1,5 @@ require "helper" +require "colorator" class TestConfiguration < JekyllUnitTest test_config = { @@ -260,7 +261,9 @@ class TestConfiguration < JekyllUnitTest allow(SafeYAML).to receive(:load_file).with(@path) do raise SystemCallError, "No such file or directory - #{@path}" end - allow($stderr).to receive(:puts).with("Configuration file: none".yellow) + allow($stderr).to receive(:puts).with( + Colorator.yellow("Configuration file: none") + ) assert_equal site_configuration, Jekyll.configuration(test_config) end @@ -275,13 +278,12 @@ class TestConfiguration < JekyllUnitTest allow($stderr) .to receive(:puts) .and_return( - ("WARNING: " - .rjust(20) + "Error reading configuration. Using defaults (and options).") - .yellow + "WARNING: ".rjust(20) + + Colorator.yellow("Error reading configuration. Using defaults (and options).") ) allow($stderr) .to receive(:puts) - .and_return("Configuration file: (INVALID) #{@path}".yellow) + .and_return(Colorator.yellow("Configuration file: (INVALID) #{@path}")) assert_equal site_configuration, Jekyll.configuration(test_config) end @@ -291,10 +293,10 @@ class TestConfiguration < JekyllUnitTest end allow($stderr) .to receive(:puts) - .with(( + .with(Colorator.red( "Fatal: ".rjust(20) + \ "The configuration file '#{@user_config}' could not be found." - ).red) + )) assert_raises LoadError do Jekyll.configuration({ "config" => [@user_config] }) end