fix partials used with blocks

feature/manifest
Jim Cushing 2016-02-03 16:55:11 -05:00
parent a2181a2fd9
commit b1778a92cd
4 changed files with 15 additions and 1 deletions

View File

@ -50,3 +50,10 @@ Feature: Provide Sane Defaults for Partial Behavior
Then I should see "File Not Found"
When I go to "/_code_snippet.html"
Then I should see "File Not Found"
Scenario: Works with blocks
Given the Server is running at "partials-app"
When I go to "/block.html"
Then I should see "Start"
And I should see "Contents"
And I should see "End"

View File

@ -0,0 +1,3 @@
Start
<%= yield %>
End

View File

@ -0,0 +1,3 @@
<% partial "block" do %>
Contents
<% end %>

View File

@ -96,8 +96,9 @@ module Middleman
#
# @param [String, Symbol] name The partial to render.
# @param [Hash] options
# @param [Proc] block A block will be evaluated to return internal contents.
# @return [String]
Contract Any, Or[Symbol, String], Hash => String
Contract Any, Or[Symbol, String], Hash => String, Maybe[Proc] => String
def render(_, name, options={}, &block)
name = name.to_s