diff --git a/spec/asciidoc_handler_spec.rb b/spec/asciidoc_handler_spec.rb index bef2cb91..82361c73 100644 --- a/spec/asciidoc_handler_spec.rb +++ b/spec/asciidoc_handler_spec.rb @@ -2,7 +2,8 @@ require 'rspec/matchers.rb' verify = lambda { |output| - output.gsub(/(^\s*\n|^\s*)/, '').should =~ %r(
+ # clean whitespace to make comparison easier + output.gsub(/(^\s*\n|^\s*|\s*$)/, '').should == %(

This is AsciiDoc in Awestruct.

@@ -22,6 +23,7 @@ page.title.should == 'AsciiDoc' page.doctitle.should == 'AsciiDoc' page.name.should == 'Awestruct' + page.layout.should == 'haml-layout' page.tags.should be_a_kind_of(Array) page.tags.should == %w(a b c) page.date.should be_a_kind_of(Date) @@ -69,7 +71,7 @@ ] describe Awestruct::Handlers::AsciidoctorHandler do - let(:additional_config_page) { {:name => 'Awestruct', :test => 10} } + let(:additional_config_page) { {:name => 'Awestruct', :test => 10, :layout => 'empty-layout'} } it_should_behave_like "a handler", theories end diff --git a/spec/support/shared_handler_example.rb b/spec/support/shared_handler_example.rb index 291c130d..dfcb9102 100644 --- a/spec/support/shared_handler_example.rb +++ b/spec/support/shared_handler_example.rb @@ -79,8 +79,7 @@ def create_handler(page) it "should render page '#{theory[:page]}'" do if theory[:unless].nil? or !theory[:unless][:exp].call() handler = create_handler theory[:page] - handler.merge! additional_config_page if respond_to?("additional_config_page") - + handler.update(additional_config_page) {|k, oldval, newval| oldval } if respond_to?("additional_config_page") output = handler.rendered_content( handler.create_context ) output.should_not be_nil diff --git a/spec/test-data/handlers/asciidoctor_with_headers.ad b/spec/test-data/handlers/asciidoctor_with_headers.ad index f9f1ca21..53f6e9b5 100644 --- a/spec/test-data/handlers/asciidoctor_with_headers.ad +++ b/spec/test-data/handlers/asciidoctor_with_headers.ad @@ -2,7 +2,8 @@ Stuart Rackham 2013-02-06 :awestruct-tags: [a, b, c] +:awestruct-layout: haml-layout :name: NOT_HANDLED This is *AsciiDoc* in {name}. -{awestruct-version} \ No newline at end of file +{awestruct-version} diff --git a/spec/test-data/handlers/empty-layout.haml b/spec/test-data/handlers/empty-layout.haml new file mode 100644 index 00000000..7125c22c --- /dev/null +++ b/spec/test-data/handlers/empty-layout.haml @@ -0,0 +1 @@ +=content