Matching tests to new colorized output
This commit is contained in:
parent
b99baeae27
commit
ef9d8ddb7d
|
@ -103,7 +103,7 @@ module Jekyll
|
||||||
def read_config_file(file)
|
def read_config_file(file)
|
||||||
configuration = dup
|
configuration = dup
|
||||||
next_config = YAML.safe_load_file(file)
|
next_config = YAML.safe_load_file(file)
|
||||||
raise "Configuration file: (INVALID) #{file}" if !next_config.is_a?(Hash)
|
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash)
|
||||||
Jekyll.info "Configuration file:", file
|
Jekyll.info "Configuration file:", file
|
||||||
configuration.deep_merge(next_config)
|
configuration.deep_merge(next_config)
|
||||||
end
|
end
|
||||||
|
@ -125,9 +125,9 @@ module Jekyll
|
||||||
# Errno:ENOENT = file not found
|
# Errno:ENOENT = file not found
|
||||||
Jekyll.warn "Configuration file:", "none"
|
Jekyll.warn "Configuration file:", "none"
|
||||||
rescue => err
|
rescue => err
|
||||||
Jekyll.warn "WARNING", "Error reading configuration. " +
|
Jekyll.warn "WARNING:", "Error reading configuration. " +
|
||||||
"Using defaults (and options)."
|
"Using defaults (and options)."
|
||||||
Jekyll.warn "", "#{err}"
|
$stderr.puts "#{err}"
|
||||||
end
|
end
|
||||||
|
|
||||||
configuration.backwards_compatibilize
|
configuration.backwards_compatibilize
|
||||||
|
|
|
@ -64,7 +64,7 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
|
|
||||||
should "fire warning with no _config.yml" do
|
should "fire warning with no _config.yml" do
|
||||||
mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
|
mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
|
||||||
mock($stderr).puts("Configuration file: none")
|
mock($stderr).puts("Configuration file: none".yellow)
|
||||||
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
|
|
||||||
should "fire warning with bad config" do
|
should "fire warning with bad config" do
|
||||||
mock(YAML).safe_load_file(@path) { Array.new }
|
mock(YAML).safe_load_file(@path) { Array.new }
|
||||||
mock($stderr).puts(" WARNING: Error reading configuration. Using defaults (and options).")
|
mock($stderr).puts(("WARNING: ".rjust(20) + "Error reading configuration. Using defaults (and options).").yellow)
|
||||||
mock($stderr).puts("Configuration file: (INVALID) #{@path}")
|
mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow)
|
||||||
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue