Sha256: 0823cb096988acc01226e20de66b88915308c30ddefa2bfb5636174ea45111d3

Contents?: true

Size: 827 Bytes

Versions: 5

Compression:

Stored size: 827 Bytes

Contents

# encoding: UTF-8
# Generators register themself on the CLI module
require "test_helper"
require "./lib/roger/template.rb"

module Roger
  # Roger template tests
  class TemplateTest < ::Test::Unit::TestCase
    def setup
      @base = Pathname.new(File.dirname(__FILE__) + "/../../project")
      @config = {
        partials_path: @base + "partials",
        layouts_path: @base + "layouts",
        source_path: @base + "html/test.html.erb"
      }
      @template_path = @base + "html"
    end

    def test_render
      template = Template.new("<%= 'test' %>", {}, source_path: "test.erb")
      assert_equal "test", template.render
    end

    def test_render_with_block
      template = Template.new("<%= yield %>", {}, source_path: "test.erb")
      assert_equal "inner", template.render { "inner" }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roger-1.6.3 test/unit/template/template_base_test.rb
roger-1.6.2 test/unit/template/template_base_test.rb
roger-1.6.1 test/unit/template/template_base_test.rb
roger-1.6.0 test/unit/template/template_base_test.rb
roger-1.5.0 test/unit/template/template_base_test.rb