android.moparisthebest.org/lib/spec/octopress/configuration_spec.rb

47 lines
1.7 KiB
Ruby
Raw Normal View History

2013-02-12 05:31:38 -05:00
require 'minitest/autorun'
require_relative '../../octopress'
2013-02-12 05:31:38 -05:00
describe Octopress::Configuration do
describe '#read_configuration' do
2013-02-12 05:31:38 -05:00
describe "when no override" do
before do
@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
@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