Feature: Local and scoped variables Scenario: local variables Given a file named "example.dryml" with: """ <% erb_local = 'Hello World' %>

<%= erb_local %>

<%= dryml_local %>

""" When I render "example.dryml" Then the output DOM should be: """

Hello World

Hello World

""" Scenario: scoped variables Given a file named "example_taglib.dryml" with: """

<%= scope.the_var %>

""" And a file named "example.dryml" with: """ """ When I include the taglib "example_taglib" And I render "example.dryml" Then the output DOM should be: """

foo

bar

foo

""" Scenario: collecting content in a scoped var Given a file named "example_taglib.dryml" with: """ <% scope.tabs_content << [id, parameters.default] %>
  • <%= name %>
    <%= this[1] %>
    """ And a file named "example.dryml" with: """

    Foo Foo Foo

    Bar Bar Bar

    Baz Baz Baz

    """ When I include the taglib "example_taglib" And I render "example.dryml" Then the output DOM should be: """

    Foo Foo Foo

    Bar Bar Bar

    Baz Baz Baz

    """