spec/asciidoc_handler_spec.rb in awestruct-0.5.1 vs spec/asciidoc_handler_spec.rb in awestruct-0.5.2
- old
+ new
@@ -1,16 +1,12 @@
require 'spec_helper'
require 'rspec/matchers.rb'
verify = lambda { |output|
- output.gsub(/(^\s*\n|^\s*)/, '').should =~ %r(<div id="preamble">
-<div class="sectionbody">
-<div class="paragraph">
-<p>This is <strong>AsciiDoc</strong> in Awestruct.</p>
-</div>
-</div>
-</div>)
+ include EmmetMatchers
+ # clean whitespace to make comparison easier
+ output.should have_structure("div#preamble>div.sectionbody>div.paragraph>p>strong")
}
verify_front_matter = lambda { |output, page|
page.title.should == 'AwestructAsciiDoc'
output.should_not =~ %r(title: AwestructAsciiDoc)
@@ -20,10 +16,11 @@
extend RSpec::Matchers
page.author.should == 'Stuart Rackham'
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)
output.should =~ %r(This is <strong>AsciiDoc</strong> in Awestruct.)
output.should =~ %r(#{Awestruct::VERSION})
@@ -67,9 +64,9 @@
:matcher => verify_headers
}
]
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