Sha256: bb38e2d674c88ef4c249c6f08826b7165d106cbf6fce98ba8b4c4e67d70fcf58

Contents?: true

Size: 779 Bytes

Versions: 15

Compression:

Stored size: 779 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 => 8623785))
  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

15 entries across 15 versions & 1 rubygems

Version Path
nanoc-3.7.4 test/helpers/test_text.rb
nanoc-3.7.3 test/helpers/test_text.rb
nanoc-3.7.2 test/helpers/test_text.rb
nanoc-3.7.1 test/helpers/test_text.rb
nanoc-3.7.0 test/helpers/test_text.rb
nanoc-3.6.11 test/helpers/test_text.rb
nanoc-3.6.10 test/helpers/test_text.rb
nanoc-3.6.9 test/helpers/test_text.rb
nanoc-3.6.8 test/helpers/test_text.rb
nanoc-3.6.7 test/helpers/test_text.rb
nanoc-3.6.6 test/helpers/test_text.rb
nanoc-3.6.5 test/helpers/test_text.rb
nanoc-3.6.4 test/helpers/test_text.rb
nanoc-3.6.3 test/helpers/test_text.rb
nanoc-3.6.2 test/helpers/test_text.rb