Permalink
Browse files

More testing, whitespace and comment cleanup.

  • Loading branch information...
1 parent dcf5462 commit e6d89c6a0f62fb72245dd266e6d7a5c7ce3c235e @simensen simensen committed Jan 23, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −1 lib/jekyll/site.rb
  2. +6 −1 test/test_site.rb
View
@@ -14,17 +14,18 @@ class Site
# 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'])
self.plugins = if config['plugins'].respond_to?('each')
# 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
@@ -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

0 comments on commit e6d89c6

Please sign in to comment.