Separate include_relative test out into its own context
This commit is contained in:
parent
0e4549013d
commit
934c37b578
|
@ -509,40 +509,40 @@ CONTENT
|
|||
assert_match %r{8 included}, @content
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "relative include tag with variable and liquid filters" do
|
||||
setup do
|
||||
stub(Jekyll).configuration do
|
||||
site_configuration({'pygments' => true})
|
||||
end
|
||||
|
||||
site = Site.new(Jekyll.configuration)
|
||||
post = Post.new(site, source_dir, '', "2014-09-02-relative-includes.markdown")
|
||||
layouts = { "default" => Layout.new(site, source_dir('_layouts'), "simple.html")}
|
||||
post.render(layouts, {"site" => {"posts" => []}})
|
||||
@content = post.content
|
||||
context "relative include tag with variable and liquid filters" do
|
||||
setup do
|
||||
stub(Jekyll).configuration do
|
||||
site_configuration({'pygments' => true})
|
||||
end
|
||||
|
||||
should "include file as variable with liquid filters" do
|
||||
assert_match %r{1 relative_include}, @content
|
||||
assert_match %r{2 relative_include}, @content
|
||||
assert_match %r{3 relative_include}, @content
|
||||
end
|
||||
site = Site.new(Jekyll.configuration)
|
||||
post = Post.new(site, source_dir, '', "2014-09-02-relative-includes.markdown")
|
||||
layouts = { "default" => Layout.new(site, source_dir('_layouts'), "simple.html")}
|
||||
post.render(layouts, {"site" => {"posts" => []}})
|
||||
@content = post.content
|
||||
end
|
||||
|
||||
should "include file as variable and liquid filters with arbitrary whitespace" do
|
||||
assert_match %r{4 relative_include}, @content
|
||||
assert_match %r{5 relative_include}, @content
|
||||
assert_match %r{6 relative_include}, @content
|
||||
end
|
||||
should "include file as variable with liquid filters" do
|
||||
assert_match %r{1 relative_include}, @content
|
||||
assert_match %r{2 relative_include}, @content
|
||||
assert_match %r{3 relative_include}, @content
|
||||
end
|
||||
|
||||
should "include file as variable and filters with additional parameters" do
|
||||
assert_match '<li>var1 = foo</li>', @content
|
||||
assert_match '<li>var2 = bar</li>', @content
|
||||
end
|
||||
should "include file as variable and liquid filters with arbitrary whitespace" do
|
||||
assert_match %r{4 relative_include}, @content
|
||||
assert_match %r{5 relative_include}, @content
|
||||
assert_match %r{6 relative_include}, @content
|
||||
end
|
||||
|
||||
should "include file as partial variable" do
|
||||
assert_match %r{8 relative_include}, @content
|
||||
end
|
||||
should "include file as variable and filters with additional parameters" do
|
||||
assert_match '<li>var1 = foo</li>', @content
|
||||
assert_match '<li>var2 = bar</li>', @content
|
||||
end
|
||||
|
||||
should "include file as partial variable" do
|
||||
assert_match %r{8 relative_include}, @content
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue