Sha256: 05aadef56b357003d15f5cfb3ed1806bd3ccd575688fb856003bf3ac3ee93121

Contents?: true

Size: 670 Bytes

Versions: 2

Compression:

Stored size: 670 Bytes

Contents

require 'test_helper'

class SquashWhitespaceTest < ActiveSupport::TestCase

  test 'remove whitespace between tags' do
    html = <<-EOS
      <div> 1 </div>
      <div> 2 </div>
      <div> 3 </div>
    EOS

    squashed = SquashWhitespace.squash_html(html)

    assert_equal '<div> 1 </div><div> 2 </div><div> 3 </div>', squashed
  end

  test 'strip whitespace in tag' do
    html = <<-EOS
      <div>
        \t 1 1
      </div>
      <div>
        \t 2 2
      </div>
      <div>
        \t 3 3
      </div>
    EOS

    squashed = SquashWhitespace.squash_html(html, strip: true)

    assert_equal '<div>1 1</div><div>2 2</div><div>3 3</div>', squashed
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
squash_whitespace-0.0.2 test/squash_whitespace_test.rb
squash_whitespace-0.0.1 test/squash_whitespace_test.rb