Sha256: 213b9ba6a92bb5a00240ce41a3469f4c305186d248d51b38c65d4ea030cb75ff

Contents?: true

Size: 834 Bytes

Versions: 21

Compression:

Stored size: 834 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
currentPath = File.dirname(__FILE__)
require File.join( currentPath, '../lib/masterview' )
require File.join( currentPath, '../lib/masterview/directives/replace')

class TestReplace < Test::Unit::TestCase
  include MasterView::Directives

  def setup
    @directives = MasterView::DirectiveSet.new
  end

  def test_replace
    tag = MasterView::Tag.new(@directives, 'foo', { 'id' => 'foobar', 'style' => 'test'}, :normal, nil)
    @directives.directives = []
    attr_value = "h @product[name]"
    @directives << Replace.new(attr_value)
    assert_equal nil, @directives.determine_dcs(:stag).render
    dcs = @directives.determine_dcs(:etag)
    dcs.context = tag.create_context
    dcs.context[:tag].content = "hello world"
    assert_equal "<%= h @product[name] %>", dcs.render
  end

end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
masterview-0.0.12 test/replace_test.rb
masterview-0.0.13 test/replace_test.rb
masterview-0.0.14 test/replace_test.rb
masterview-0.0.16 test/replace_test.rb
masterview-0.0.2 test/replace_test.rb
masterview-0.0.10 test/replace_test.rb
masterview-0.0.17 test/replace_test.rb
masterview-0.0.15 test/replace_test.rb
masterview-0.0.11 test/replace_test.rb
masterview-0.1.3 test/replace_test.rb
masterview-0.0.8 test/replace_test.rb
masterview-0.1.5 test/replace_test.rb
masterview-0.0.9 test/replace_test.rb
masterview-0.1.0 test/replace_test.rb
masterview-0.1.1 test/replace_test.rb
masterview-0.1.2 test/replace_test.rb
masterview-0.0.7 test/replace_test.rb
masterview_parser-0.0.6 test/replace_test.rb
masterview_parser-0.0.4 test/replace_test.rb
masterview_parser-0.0.5 test/replace_test.rb