2013-02-12 05:31:38 -05:00
|
|
|
require 'minitest/autorun'
|
2013-02-16 20:51:07 -05:00
|
|
|
require_relative '../../octopress'
|
2013-02-12 05:31:38 -05:00
|
|
|
|
|
|
|
describe Octopress::Configuration do
|
2013-02-16 20:51:07 -05:00
|
|
|
describe '#read_configuration' do
|
2013-02-12 05:31:38 -05:00
|
|
|
describe "when no override" do
|
|
|
|
before do
|
2013-02-16 20:51:07 -05:00
|
|
|
@octo_config = Octopress::Configuration.new(File.join(File.dirname(__FILE__), '../', 'fixtures', 'no_override'))
|
|
|
|
end
|
|
|
|
|
|
|
|
subject do
|
|
|
|
@octo_config.read_configuration
|
2013-02-12 05:31:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns the default config with keys as symbols" do
|
|
|
|
expected_config = { :url => "http://yoursite.com",
|
|
|
|
:title => "My Octopress Blog",
|
|
|
|
:subtitle => "A blogging framework for hackers.",
|
|
|
|
:author => "Your Name",
|
|
|
|
:simple_search => "http://google.com/search",
|
|
|
|
:description => nil }
|
|
|
|
subject.must_equal expected_config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "when override" do
|
|
|
|
before do
|
2013-02-16 20:51:07 -05:00
|
|
|
@octo_config = Octopress::Configuration.new(File.join(File.dirname(__FILE__), '../', 'fixtures', 'override'))
|
|
|
|
end
|
|
|
|
|
|
|
|
subject do
|
|
|
|
@octo_config.read_configuration
|
2013-02-12 05:31:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns the default config with keys as symbols" do
|
|
|
|
expected_config = { :url => "http://myownsite.com",
|
|
|
|
:title => "My Octopress custom Blog",
|
|
|
|
:subtitle => "How did this get here? I'm not good with computers",
|
|
|
|
:author => "John Doe",
|
|
|
|
:simple_search => "http://google.com/search",
|
|
|
|
:description => nil }
|
|
|
|
subject.must_equal expected_config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|