File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,18 @@ class Site
1414 # config - A Hash containing site configuration details.
1515 def initialize ( config )
1616 self . config = config . clone
17+
1718 self . safe = config [ 'safe' ]
1819 self . source = File . expand_path ( config [ 'source' ] )
1920 self . dest = File . expand_path ( config [ 'destination' ] )
2021 self . plugins = if config [ 'plugins' ] . respond_to? ( 'each' )
2122 # If plugins is an array, process it.
2223 Array ( config [ 'plugins' ] ) . map { |d | File . expand_path ( d ) }
2324 else
24- # Otherwise process a single entry as an array.
2525 if config [ 'plugins' ] . nil?
2626 [ ]
2727 else
28+ # Otherwise process a single entry as an array.
2829 [ File . expand_path ( config [ 'plugins' ] ) ]
2930 end
3031 end
Original file line number Diff line number Diff line change @@ -17,10 +17,15 @@ class TestSite < Test::Unit::TestCase
1717 assert_equal [ '/tmp/plugins' , '/tmp/otherplugins' ] , site . plugins
1818 end
1919
20- should "have an array for plugins if nothing is passed" do
20+ should "have an empty array for plugins if nothing is passed" do
2121 site = Site . new ( Jekyll ::DEFAULTS . merge ( { 'plugins' => [ ] } ) )
2222 assert_equal [ ] , site . plugins
2323 end
24+
25+ should "have an empty array for plugins if nil is passed" do
26+ site = Site . new ( Jekyll ::DEFAULTS . merge ( { 'plugins' => nil } ) )
27+ assert_equal [ ] , site . plugins
28+ end
2429 end
2530 context "creating sites" do
2631 setup do
You can’t perform that action at this time.
0 commit comments