From e6d89c6a0f62fb72245dd266e6d7a5c7ce3c235e Mon Sep 17 00:00:00 2001 From: Beau Simensen Date: Sun, 22 Jan 2012 22:17:25 -0800 Subject: [PATCH] More testing, whitespace and comment cleanup. --- lib/jekyll/site.rb | 3 ++- test/test_site.rb | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 0788223f88e..c9eb481dc91 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -14,6 +14,7 @@ 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']) @@ -21,10 +22,10 @@ def initialize(config) # 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 diff --git a/test/test_site.rb b/test/test_site.rb index 1c9b153490c..d9037730d50 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -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