Sha256: 3f444f10f8d9200322454f77d574640f7805237588d0100ba0ee2983a633ae6b

Contents?: true

Size: 762 Bytes

Versions: 6

Compression:

Stored size: 762 Bytes

Contents

# encoding: utf-8

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

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-4.0.0b2 test/helpers/test_text.rb
nanoc-4.0.0b1 test/helpers/test_text.rb
nanoc-4.0.0a2 test/helpers/test_text.rb
nanoc-4.0.0a1 test/helpers/test_text.rb
nanoc-3.8.0 test/helpers/test_text.rb
nanoc-3.7.5 test/helpers/test_text.rb