Move Jekyll::DEFAULTS to Jekyll::Configuration::DEFAULTS
This commit is contained in:
parent
5c680db758
commit
04fd68a232
|
@ -28,6 +28,7 @@ require 'pygments'
|
||||||
|
|
||||||
# internal requires
|
# internal requires
|
||||||
require 'jekyll/core_ext'
|
require 'jekyll/core_ext'
|
||||||
|
require 'jekyll/configuration'
|
||||||
require 'jekyll/site'
|
require 'jekyll/site'
|
||||||
require 'jekyll/convertible'
|
require 'jekyll/convertible'
|
||||||
require 'jekyll/layout'
|
require 'jekyll/layout'
|
||||||
|
@ -54,76 +55,11 @@ SafeYAML::OPTIONS[:suppress_warnings] = true
|
||||||
module Jekyll
|
module Jekyll
|
||||||
VERSION = '1.0.0.beta4'
|
VERSION = '1.0.0.beta4'
|
||||||
|
|
||||||
# Default options. Overriden by values in _config.yml.
|
|
||||||
# Strings rather than symbols are used for compatability with YAML.
|
|
||||||
DEFAULTS = {
|
|
||||||
'source' => Dir.pwd,
|
|
||||||
'destination' => File.join(Dir.pwd, '_site'),
|
|
||||||
'plugins' => '_plugins',
|
|
||||||
'layouts' => '_layouts',
|
|
||||||
'keep_files' => ['.git','.svn'],
|
|
||||||
|
|
||||||
'future' => true, # remove and make true just default
|
|
||||||
'pygments' => true, # remove and make true just default
|
|
||||||
|
|
||||||
'markdown' => 'maruku',
|
|
||||||
'permalink' => 'date',
|
|
||||||
'baseurl' => '/',
|
|
||||||
'include' => ['.htaccess'],
|
|
||||||
'paginate_path' => 'page:num',
|
|
||||||
|
|
||||||
'markdown_ext' => 'markdown,mkd,mkdn,md',
|
|
||||||
'textile_ext' => 'textile',
|
|
||||||
|
|
||||||
'port' => '4000',
|
|
||||||
'host' => '0.0.0.0',
|
|
||||||
|
|
||||||
'excerpt_separator' => "\n\n",
|
|
||||||
|
|
||||||
'maruku' => {
|
|
||||||
'use_tex' => false,
|
|
||||||
'use_divs' => false,
|
|
||||||
'png_engine' => 'blahtex',
|
|
||||||
'png_dir' => 'images/latex',
|
|
||||||
'png_url' => '/images/latex'
|
|
||||||
},
|
|
||||||
|
|
||||||
'rdiscount' => {
|
|
||||||
'extensions' => []
|
|
||||||
},
|
|
||||||
|
|
||||||
'redcarpet' => {
|
|
||||||
'extensions' => []
|
|
||||||
},
|
|
||||||
|
|
||||||
'kramdown' => {
|
|
||||||
'auto_ids' => true,
|
|
||||||
'footnote_nr' => 1,
|
|
||||||
'entity_output' => 'as_char',
|
|
||||||
'toc_levels' => '1..6',
|
|
||||||
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
|
||||||
'use_coderay' => false,
|
|
||||||
|
|
||||||
'coderay' => {
|
|
||||||
'coderay_wrap' => 'div',
|
|
||||||
'coderay_line_numbers' => 'inline',
|
|
||||||
'coderay_line_number_start' => 1,
|
|
||||||
'coderay_tab_width' => 4,
|
|
||||||
'coderay_bold_every' => 10,
|
|
||||||
'coderay_css' => 'style'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
'redcloth' => {
|
|
||||||
'hard_breaks' => true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Public: Generate a Jekyll configuration Hash by merging the default
|
# Public: Generate a Jekyll configuration Hash by merging the default
|
||||||
# options with anything in _config.yml, and adding the given options on top.
|
# options with anything in _config.yml, and adding the given options on top.
|
||||||
#
|
#
|
||||||
# override - A Hash of config directives that override any options in both
|
# override - A Hash of config directives that override any options in both
|
||||||
# the defaults and the config file. See Jekyll::DEFAULTS for a
|
# the defaults and the config file. See Jekyll::Configuration::DEFAULTS for a
|
||||||
# list of option names and their defaults.
|
# list of option names and their defaults.
|
||||||
#
|
#
|
||||||
# Returns the final configuration Hash.
|
# Returns the final configuration Hash.
|
||||||
|
|
|
@ -97,7 +97,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns an Array of plugin search paths
|
# Returns an Array of plugin search paths
|
||||||
def plugins_path
|
def plugins_path
|
||||||
if (config['plugins'] == Jekyll::DEFAULTS['plugins'])
|
if (config['plugins'] == Jekyll::Configuration::DEFAULTS['plugins'])
|
||||||
[File.join(self.source, config['plugins'])]
|
[File.join(self.source, config['plugins'])]
|
||||||
else
|
else
|
||||||
Array(config['plugins']).map { |d| File.expand_path(d) }
|
Array(config['plugins']).map { |d| File.expand_path(d) }
|
||||||
|
|
|
@ -9,20 +9,20 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
should "fire warning with no _config.yml" do
|
should "fire warning with no _config.yml" do
|
||||||
mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
|
mock(YAML).safe_load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" }
|
||||||
mock($stderr).puts("Configuration file: none")
|
mock($stderr).puts("Configuration file: none")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
|
|
||||||
should "load configuration as hash" do
|
should "load configuration as hash" do
|
||||||
mock(YAML).safe_load_file(@path) { Hash.new }
|
mock(YAML).safe_load_file(@path) { Hash.new }
|
||||||
mock($stdout).puts("Configuration file: #{@path}")
|
mock($stdout).puts("Configuration file: #{@path}")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
|
|
||||||
should "fire warning with bad config" do
|
should "fire warning with bad config" do
|
||||||
mock(YAML).safe_load_file(@path) { Array.new }
|
mock(YAML).safe_load_file(@path) { Array.new }
|
||||||
mock($stderr).puts(" WARNING: Error reading configuration. Using defaults (and options).")
|
mock($stderr).puts(" WARNING: Error reading configuration. Using defaults (and options).")
|
||||||
mock($stderr).puts("Configuration file: (INVALID) #{@path}")
|
mock($stderr).puts("Configuration file: (INVALID) #{@path}")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
context "loading config from external file" do
|
context "loading config from external file" do
|
||||||
|
@ -37,19 +37,19 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
should "load default config if no config_file is set" do
|
should "load default config if no config_file is set" do
|
||||||
mock(YAML).safe_load_file(@paths[:default]) { Hash.new }
|
mock(YAML).safe_load_file(@paths[:default]) { Hash.new }
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
|
||||||
end
|
end
|
||||||
|
|
||||||
should "load different config if specified" do
|
should "load different config if specified" do
|
||||||
mock(YAML).safe_load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} }
|
mock(YAML).safe_load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} }
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
||||||
assert_equal Jekyll::DEFAULTS.deep_merge({ "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => @paths[:other] })
|
assert_equal Jekyll::Configuration::DEFAULTS.deep_merge({ "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => @paths[:other] })
|
||||||
end
|
end
|
||||||
|
|
||||||
should "load default config if path passed is empty" do
|
should "load default config if path passed is empty" do
|
||||||
mock(YAML).safe_load_file(@paths[:default]) { Hash.new }
|
mock(YAML).safe_load_file(@paths[:default]) { Hash.new }
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({ "config" => @paths[:empty] })
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({ "config" => @paths[:empty] })
|
||||||
end
|
end
|
||||||
|
|
||||||
should "load multiple config files" do
|
should "load multiple config files" do
|
||||||
|
@ -57,7 +57,7 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
mock(YAML).safe_load_file(@paths[:other]) { Hash.new }
|
mock(YAML).safe_load_file(@paths[:other]) { Hash.new }
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
||||||
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({ "config" => [@paths[:default], @paths[:other]] })
|
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({ "config" => [@paths[:default], @paths[:other]] })
|
||||||
end
|
end
|
||||||
|
|
||||||
should "load multiple config files and last config should win" do
|
should "load multiple config files and last config should win" do
|
||||||
|
@ -65,7 +65,7 @@ class TestConfiguration < Test::Unit::TestCase
|
||||||
mock(YAML).safe_load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} }
|
mock(YAML).safe_load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} }
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
mock($stdout).puts("Configuration file: #{@paths[:default]}")
|
||||||
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
mock($stdout).puts("Configuration file: #{@paths[:other]}")
|
||||||
assert_equal Jekyll::DEFAULTS.deep_merge({ "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => [@paths[:default], @paths[:other]] })
|
assert_equal Jekyll::Configuration::DEFAULTS.deep_merge({ "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => [@paths[:default], @paths[:other]] })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
||||||
end
|
end
|
||||||
|
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
|
@ -46,7 +46,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 5})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 5})
|
||||||
end
|
end
|
||||||
|
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
|
@ -62,7 +62,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||||
assert_raise ArgumentError do
|
assert_raise ArgumentError do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0})
|
||||||
end
|
end
|
||||||
|
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
|
|
|
@ -15,7 +15,7 @@ class TestPage < Test::Unit::TestCase
|
||||||
context "A Page" do
|
context "A Page" do
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class TestPager < Test::Unit::TestCase
|
||||||
context "pagination disabled" do
|
context "pagination disabled" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({
|
Jekyll::Configuration::DEFAULTS.merge({
|
||||||
'source' => source_dir,
|
'source' => source_dir,
|
||||||
'destination' => dest_dir
|
'destination' => dest_dir
|
||||||
})
|
})
|
||||||
|
@ -31,7 +31,7 @@ class TestPager < Test::Unit::TestCase
|
||||||
context "pagination enabled for 2" do
|
context "pagination enabled for 2" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({
|
Jekyll::Configuration::DEFAULTS.merge({
|
||||||
'source' => source_dir,
|
'source' => source_dir,
|
||||||
'destination' => dest_dir,
|
'destination' => dest_dir,
|
||||||
'paginate' => 2
|
'paginate' => 2
|
||||||
|
|
|
@ -13,7 +13,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
context "A Post" do
|
context "A Post" do
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
context "when in a site" do
|
context "when in a site" do
|
||||||
setup do
|
setup do
|
||||||
clear_dest
|
clear_dest
|
||||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
@site.posts = [setup_post('2008-02-02-published.textile'),
|
@site.posts = [setup_post('2008-02-02-published.textile'),
|
||||||
setup_post('2009-01-27-categories.textile')]
|
setup_post('2009-01-27-categories.textile')]
|
||||||
|
@ -537,7 +537,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
|
|
||||||
context "converter file extension settings" do
|
context "converter file extension settings" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration { Jekyll::DEFAULTS }
|
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,49 +3,49 @@ require 'helper'
|
||||||
class TestSite < Test::Unit::TestCase
|
class TestSite < Test::Unit::TestCase
|
||||||
context "configuring sites" do
|
context "configuring sites" do
|
||||||
should "have an array for plugins by default" do
|
should "have an array for plugins by default" do
|
||||||
site = Site.new(Jekyll::DEFAULTS)
|
site = Site.new(Jekyll::Configuration::DEFAULTS)
|
||||||
assert_equal [File.join(Dir.pwd, '_plugins')], site.plugins
|
assert_equal [File.join(Dir.pwd, '_plugins')], site.plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
should "look for plugins under the site directory by default" do
|
should "look for plugins under the site directory by default" do
|
||||||
site = Site.new(Jekyll::DEFAULTS.merge({'source' => File.expand_path(source_dir)}))
|
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'source' => File.expand_path(source_dir)}))
|
||||||
assert_equal [File.join(source_dir, '_plugins')], site.plugins
|
assert_equal [File.join(source_dir, '_plugins')], site.plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have an array for plugins if passed as a string" do
|
should "have an array for plugins if passed as a string" do
|
||||||
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => '/tmp/plugins'}))
|
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => '/tmp/plugins'}))
|
||||||
assert_equal ['/tmp/plugins'], site.plugins
|
assert_equal ['/tmp/plugins'], site.plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have an array for plugins if passed as an array" do
|
should "have an array for plugins if passed as an array" do
|
||||||
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => ['/tmp/plugins', '/tmp/otherplugins']}))
|
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => ['/tmp/plugins', '/tmp/otherplugins']}))
|
||||||
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
|
assert_equal ['/tmp/plugins', '/tmp/otherplugins'], site.plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
should "have an empty 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::Configuration::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
|
should "have an empty array for plugins if nil is passed" do
|
||||||
site = Site.new(Jekyll::DEFAULTS.merge({'plugins' => nil}))
|
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'plugins' => nil}))
|
||||||
assert_equal [], site.plugins
|
assert_equal [], site.plugins
|
||||||
end
|
end
|
||||||
|
|
||||||
should "expose default baseurl" do
|
should "expose default baseurl" do
|
||||||
site = Site.new(Jekyll::DEFAULTS)
|
site = Site.new(Jekyll::Configuration::DEFAULTS)
|
||||||
assert_equal Jekyll::DEFAULTS['baseurl'], site.baseurl
|
assert_equal Jekyll::Configuration::DEFAULTS['baseurl'], site.baseurl
|
||||||
end
|
end
|
||||||
|
|
||||||
should "expose baseurl passed in from config" do
|
should "expose baseurl passed in from config" do
|
||||||
site = Site.new(Jekyll::DEFAULTS.merge({'baseurl' => '/blog'}))
|
site = Site.new(Jekyll::Configuration::DEFAULTS.merge({'baseurl' => '/blog'}))
|
||||||
assert_equal '/blog', site.baseurl
|
assert_equal '/blog', site.baseurl
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
context "creating sites" do
|
context "creating sites" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
|
||||||
end
|
end
|
||||||
@site = Site.new(Jekyll.configuration)
|
@site = Site.new(Jekyll.configuration)
|
||||||
end
|
end
|
||||||
|
@ -205,7 +205,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
|
|
||||||
should "filter symlink entries when safe mode enabled" do
|
should "filter symlink entries when safe mode enabled" do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
stub(File).symlink?('symlink.js') {true}
|
stub(File).symlink?('symlink.js') {true}
|
||||||
|
@ -221,7 +221,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
|
|
||||||
should "not include symlinks in safe mode" do
|
should "not include symlinks in safe mode" do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => true})
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
|
|
||||||
should "include symlinks in unsafe mode" do
|
should "include symlinks in unsafe mode" do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => false})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'safe' => false})
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
context 'error handling' do
|
context 'error handling' do
|
||||||
should "raise if destination is included in source" do
|
should "raise if destination is included in source" do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => source_dir})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => source_dir})
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise Jekyll::FatalException do
|
assert_raise Jekyll::FatalException do
|
||||||
|
@ -254,7 +254,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
|
|
||||||
should "raise if destination is source" do
|
should "raise if destination is source" do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => File.join(source_dir, "..")})
|
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => File.join(source_dir, "..")})
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise Jekyll::FatalException do
|
assert_raise Jekyll::FatalException do
|
||||||
|
@ -303,7 +303,7 @@ class TestSite < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'remove orphaned files in destination - keep_files .svn' do
|
should 'remove orphaned files in destination - keep_files .svn' do
|
||||||
config = Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'keep_files' => ['.svn']})
|
config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'keep_files' => ['.svn']})
|
||||||
@site = Site.new(config)
|
@site = Site.new(config)
|
||||||
@site.process
|
@site.process
|
||||||
assert !File.exist?(dest_dir('.htpasswd'))
|
assert !File.exist?(dest_dir('.htpasswd'))
|
||||||
|
|
|
@ -6,7 +6,7 @@ class TestTags < Test::Unit::TestCase
|
||||||
|
|
||||||
def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown)
|
def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown)
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
Jekyll::DEFAULTS.deep_merge({'pygments' => true}).deep_merge(override)
|
Jekyll::Configuration::DEFAULTS.deep_merge({'pygments' => true}).deep_merge(override)
|
||||||
end
|
end
|
||||||
site = Site.new(Jekyll.configuration)
|
site = Site.new(Jekyll.configuration)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue