Sha256: 2becbeabef3cbd5edda4dfc8c749d5f4b7e5fa599ac08cf861adf437ed419276

Contents?: true

Size: 743 Bytes

Versions: 19

Compression:

Stored size: 743 Bytes

Contents

class Nanoc::Helpers::TextTest < Nanoc::TestCase
  include Nanoc::Helpers::Text

  def test_excerpt_length
    assert_equal('...',                         excerptize('Foo bar baz quux meow woof', length: 3))
    assert_equal('Foo ...',                     excerptize('Foo bar baz quux meow woof', length: 7))
    assert_equal('Foo bar baz quux meow woof',  excerptize('Foo bar baz quux meow woof', length: 26))
    assert_equal('Foo bar baz quux meow woof',  excerptize('Foo bar baz quux meow woof', length: 8_623_785))
  end

  def test_excerpt_omission
    assert_equal('Foo [continued]',             excerptize('Foo bar baz quux meow woof', length: 15, omission: '[continued]'))
  end

  def test_strip_html
    # TODO: implement
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
nanoc-4.1.6 test/helpers/test_text.rb
nanoc-4.1.5 test/helpers/test_text.rb
nanoc-4.1.4 test/helpers/test_text.rb
nanoc-4.1.3 test/helpers/test_text.rb
nanoc-4.1.2 test/helpers/test_text.rb
nanoc-4.1.1 test/helpers/test_text.rb
nanoc-4.1.0 test/helpers/test_text.rb
nanoc-4.1.0rc2 test/helpers/test_text.rb
nanoc-4.1.0rc1 test/helpers/test_text.rb
nanoc-4.1.0b1 test/helpers/test_text.rb
nanoc-4.1.0a1 test/helpers/test_text.rb
nanoc-4.0.2 test/helpers/test_text.rb
nanoc-4.0.1 test/helpers/test_text.rb
nanoc-4.0.0 test/helpers/test_text.rb
nanoc-4.0.0rc3 test/helpers/test_text.rb
nanoc-4.0.0rc2 test/helpers/test_text.rb
nanoc-4.0.0rc1 test/helpers/test_text.rb
nanoc-4.0.0b4 test/helpers/test_text.rb
nanoc-4.0.0b3 test/helpers/test_text.rb