Sha256: 34ec2f0dd13d82180fa0e8efdae9935449fb608cc7f3e8b393ef85abb9a2062a

Contents?: true

Size: 749 Bytes

Versions: 15

Compression:

Stored size: 749 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/test_helper'
require 'webgen/content_processor/erb'

class TestErb < Minitest::Test

  include Webgen::TestHelper

  def test_static_call
    setup_context
    cp = Webgen::ContentProcessor::Erb

    @context.content = "<%= context[:doit] %>6\n<%= context.ref_node.alcn %>\n<%= context.node.alcn %>\n<%= context.dest_node.alcn %><% context.website %>"
    assert_equal("hallo6\n/test\n/test\n/test", cp.call(@context).content)

    @website.config['content_processor.erb.trim_mode'] = '%'
    @context.content = "% 3.times do\na\n% end"
    assert_equal("a\na\na\n", cp.call(@context).content)

    @context.content = "\n<%= 5* %>"
    assert_error_on_line(SyntaxError, 2) { cp.call(@context) }
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webgen-1.7.3 test/webgen/content_processor/test_erb.rb
webgen-1.7.2 test/webgen/content_processor/test_erb.rb
webgen-1.7.1 test/webgen/content_processor/test_erb.rb
webgen-1.7.0 test/webgen/content_processor/test_erb.rb
webgen-1.6.0 test/webgen/content_processor/test_erb.rb
webgen-1.5.2 test/webgen/content_processor/test_erb.rb
webgen-1.5.1 test/webgen/content_processor/test_erb.rb
webgen-1.5.0 test/webgen/content_processor/test_erb.rb
webgen-1.4.1 test/webgen/content_processor/test_erb.rb
webgen-1.4.0 test/webgen/content_processor/test_erb.rb
webgen-1.3.0 test/webgen/content_processor/test_erb.rb
webgen-1.2.1 test/webgen/content_processor/test_erb.rb
webgen-1.2.0 test/webgen/content_processor/test_erb.rb
webgen-1.1.0 test/webgen/content_processor/test_erb.rb
webgen-1.0.0 test/webgen/content_processor/test_erb.rb