More testing, whitespace and comment cleanup.

This commit is contained in:
Beau Simensen 2012-01-22 22:17:25 -08:00
parent dcf546275b
commit e6d89c6a0f
2 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,7 @@ module Jekyll
# config - A Hash containing site configuration details.
def initialize(config)
self.config = config.clone
self.safe = config['safe']
self.source = File.expand_path(config['source'])
self.dest = File.expand_path(config['destination'])
@ -21,10 +22,10 @@ module Jekyll
# If plugins is an array, process it.
Array(config['plugins']).map { |d| File.expand_path(d) }
else
# Otherwise process a single entry as an array.
if config['plugins'].nil?
[]
else
# Otherwise process a single entry as an array.
[File.expand_path(config['plugins'])]
end
end

View File

@ -17,10 +17,15 @@ class TestSite < Test::Unit::TestCase
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
end
should "have an array for plugins if nothing is passed" do
should "have an empty array for plugins if nothing is passed" do
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => []}))
assert_equal [], site.plugins
end
should "have an empty array for plugins if nil is passed" do
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => nil}))
assert_equal [], site.plugins
end
end
context "creating sites" do
setup do