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)
|
||||
configuration = dup
|
||||
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
|
||||
configuration.deep_merge(next_config)
|
||||
end
|
||||
|
@ -125,9 +125,9 @@ module Jekyll
|
|||
# Errno:ENOENT = file not found
|
||||
Jekyll.warn "Configuration file:", "none"
|
||||
rescue => err
|
||||
Jekyll.warn "WARNING", "Error reading configuration. " +
|
||||
Jekyll.warn "WARNING:", "Error reading configuration. " +
|
||||
"Using defaults (and options)."
|
||||
Jekyll.warn "", "#{err}"
|
||||
$stderr.puts "#{err}"
|
||||
end
|
||||
|
||||
configuration.backwards_compatibilize
|
||||
|
|
|
@ -64,7 +64,7 @@ class TestConfiguration < Test::Unit::TestCase
|
|||
|
||||
should "fire warning with no _config.yml" do
|
||||
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({})
|
||||
end
|
||||
|
||||
|
@ -76,8 +76,8 @@ class TestConfiguration < Test::Unit::TestCase
|
|||
|
||||
should "fire warning with bad config" do
|
||||
mock(YAML).safe_load_file(@path) { Array.new }
|
||||
mock($stderr).puts(" WARNING: Error reading configuration. Using defaults (and options).")
|
||||
mock($stderr).puts("Configuration file: (INVALID) #{@path}")
|
||||
mock($stderr).puts(("WARNING: ".rjust(20) + "Error reading configuration. Using defaults (and options).").yellow)
|
||||
mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow)
|
||||
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue