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
|
assert_match %r{8 included}, @content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "relative include tag with variable and liquid filters" do
|
context "relative include tag with variable and liquid filters" do
|
||||||
setup do
|
setup do
|
||||||
stub(Jekyll).configuration do
|
stub(Jekyll).configuration do
|
||||||
site_configuration({'pygments' => true})
|
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
should "include file as variable with liquid filters" do
|
site = Site.new(Jekyll.configuration)
|
||||||
assert_match %r{1 relative_include}, @content
|
post = Post.new(site, source_dir, '', "2014-09-02-relative-includes.markdown")
|
||||||
assert_match %r{2 relative_include}, @content
|
layouts = { "default" => Layout.new(site, source_dir('_layouts'), "simple.html")}
|
||||||
assert_match %r{3 relative_include}, @content
|
post.render(layouts, {"site" => {"posts" => []}})
|
||||||
end
|
@content = post.content
|
||||||
|
end
|
||||||
|
|
||||||
should "include file as variable and liquid filters with arbitrary whitespace" do
|
should "include file as variable with liquid filters" do
|
||||||
assert_match %r{4 relative_include}, @content
|
assert_match %r{1 relative_include}, @content
|
||||||
assert_match %r{5 relative_include}, @content
|
assert_match %r{2 relative_include}, @content
|
||||||
assert_match %r{6 relative_include}, @content
|
assert_match %r{3 relative_include}, @content
|
||||||
end
|
end
|
||||||
|
|
||||||
should "include file as variable and filters with additional parameters" do
|
should "include file as variable and liquid filters with arbitrary whitespace" do
|
||||||
assert_match '<li>var1 = foo</li>', @content
|
assert_match %r{4 relative_include}, @content
|
||||||
assert_match '<li>var2 = bar</li>', @content
|
assert_match %r{5 relative_include}, @content
|
||||||
end
|
assert_match %r{6 relative_include}, @content
|
||||||
|
end
|
||||||
|
|
||||||
should "include file as partial variable" do
|
should "include file as variable and filters with additional parameters" do
|
||||||
assert_match %r{8 relative_include}, @content
|
assert_match '<li>var1 = foo</li>', @content
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue