Sha256: 79093deb496161a5bbddca20095b67bd9495d11000c62a281cdaa9a324c5a24a

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

require 'helper'


class TestSlimWrapper < TestSlim
  def setup
    Slim::Sections.set_default_options(:dictionary => 'ViewEnv.new')
  end

  def teardown
    Slim::Sections.set_default_options(:dictionary => 'self')
  end

  def test_sections
    source = %q{
<p
 - person
  <.name>= name
}
    assert_html '<p><div class="name">Joe</div><div class="name">Jack</div></p>', source, :sections => true
  end

  def test_with_array
    source = %q{
<ul
 - people_with_locations
  <li>= name
  <li>= city
}
    assert_html '<ul><li>Andy</li> <li>Atlanta</li><li>Fred</li> <li>Melbourne</li><li>Daniel</li> <li>Karlsruhe</li></ul>', source, :sections => true
  end

  def test_method
    source = %q{
<a href=output_number>Link
}
    assert_html '<a href="output_number">Link</a>', source, :sections => true
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hamlet-0.5.0.1 test/slim/test_wrapper.rb
hamlet-0.5.0 test/slim/test_wrapper.rb