# -*- coding: UTF-8 -*-
require 'spec_helper'
verify = lambda { |output|
output.should =~ %r(
This is a Slim page
)
}
verify_atom = lambda { |output|
output.should == 'http://example.comA News Feed'
}
verify_with_markdown = lambda { |output|
output.should =~ %r(]*>Hello From Markdown
)
}
verify_with_textile = lambda { |output|
output.should =~ %r(Hello From Textile
)
}
verify_with_utf8 = lambda { |output|
output.should =~ %r(Besøg fra Danmark
)
}
verify_with_variables = lambda { |output|
output.should =~ %r(bacon
)
}
theories =
[
{
:page => 'slim-page.html.slim',
:simple_name => 'slim-page',
:syntax => :slim,
:extension => '.html',
:format => :html5,
:matcher => verify
},
{
:page => 'slim-page.xml.slim',
:simple_name => 'slim-page',
:syntax => :slim,
:extension => '.xml',
:format => :xhtml,
:matcher => verify
},
{
:page => 'slim-page.atom.slim',
:simple_name => 'slim-page',
:syntax => :slim,
:extension => '.atom',
:format => :xhtml,
:matcher => verify_atom
},
{
:page => 'slim-with-markdown-page.html.slim',
:simple_name => 'slim-with-markdown-page',
:syntax => :slim,
:extension => '.html',
:matcher => verify_with_markdown
},
{
:page => 'slim-with-utf.html.slim',
:simple_name => 'slim-with-utf',
:syntax => :slim,
:extension => '.html',
:matcher => verify_with_utf8
},
{
:page => 'slim-with-variables.html.slim',
:simple_name => 'slim-with-variables',
:syntax => :slim,
:extension => '.html',
:matcher => verify_with_variables
}
]
describe Awestruct::Handlers::TiltHandler.to_s + '-Slim' do
let(:additional_config) { {:crunchy => 'bacon'} }
it_should_behave_like 'a handler', theories
end