Sha256: 22e9eaa74929565665bb4c3ddd8dbc89028f14da44028cb59a7e7edd92016c1d

Contents?: true

Size: 786 Bytes

Versions: 10

Compression:

Stored size: 786 Bytes

Contents

require File.expand_path('../helper', __FILE__)

describe Cutaneous do
  let(:template_root) { File.expand_path("../fixtures", __FILE__)                     }
  let(:engine)        { Cutaneous::Engine.new(template_root, Cutaneous::FirstPassSyntax, "html") }

  it "Will parse & execute a simple template with expressions" do
    context = ContextHash(right: "right", code: "<tag/>")
    result = engine.render("c", context)
    expected = ["aa\n\n", "ab", "bb", "cb", "ac", "ad", "ae", "cf", "ag\n"].join("\n\n")
    result.must_equal expected
  end

  it "Won't run code in inherited templates unless called" do
    context = ContextHash(right: "right", code: "<tag/>")
    result = engine.render("e", context)
    result.must_equal ["da", "db", "dc", "ed\n\n"].join("\n\n")
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cutaneous-0.3.0 test/test_blocks.rb
cutaneous-0.2.0 test/test_blocks.rb
cutaneous-0.1.7 test/test_blocks.rb
cutaneous-0.1.6 test/test_blocks.rb
cutaneous-0.1.5 test/test_blocks.rb
cutaneous-0.1.4 test/test_blocks.rb
cutaneous-0.1.3 test/test_blocks.rb
cutaneous-0.1.2 test/test_blocks.rb
cutaneous-0.1.1 test/test_blocks.rb
cutaneous-0.1.0 test/test_blocks.rb