More testing, whitespace and comment cleanup.
This commit is contained in:
parent
dcf546275b
commit
e6d89c6a0f
|
@ -14,6 +14,7 @@ module Jekyll
|
||||||
# config - A Hash containing site configuration details.
|
# config - A Hash containing site configuration details.
|
||||||
def initialize(config)
|
def initialize(config)
|
||||||
self.config = config.clone
|
self.config = config.clone
|
||||||
|
|
||||||
self.safe = config['safe']
|
self.safe = config['safe']
|
||||||
self.source = File.expand_path(config['source'])
|
self.source = File.expand_path(config['source'])
|
||||||
self.dest = File.expand_path(config['destination'])
|
self.dest = File.expand_path(config['destination'])
|
||||||
|
@ -21,10 +22,10 @@ module Jekyll
|
||||||
# If plugins is an array, process it.
|
# If plugins is an array, process it.
|
||||||
Array(config['plugins']).map { |d| File.expand_path(d) }
|
Array(config['plugins']).map { |d| File.expand_path(d) }
|
||||||
else
|
else
|
||||||
# Otherwise process a single entry as an array.
|
|
||||||
if config['plugins'].nil?
|
if config['plugins'].nil?
|
||||||
[]
|
[]
|
||||||
else
|
else
|
||||||
|
# Otherwise process a single entry as an array.
|
||||||
[File.expand_path(config['plugins'])]
|
[File.expand_path(config['plugins'])]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,10 +17,15 @@ class TestSite < Test::Unit::TestCase
|
||||||
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
|
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
|
||||||
end
|
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' => []}))
|
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => []}))
|
||||||
assert_equal [], site.plugins
|
assert_equal [], site.plugins
|
||||||
end
|
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
|
end
|
||||||
context "creating sites" do
|
context "creating sites" do
|
||||||
setup do
|
setup do
|
||||||
|
|
Loading…
Reference in New Issue