Sha256: 608cc6ee9457be91efa41d91332c8925f8d475dcdee0a60dbfeb2316018d93c3

Contents?: true

Size: 818 Bytes

Versions: 17

Compression:

Stored size: 818 Bytes

Contents

# encoding: utf-8

class Nanoc::Helpers::TextTest < MiniTest::Unit::TestCase

  include Nanoc::TestHelpers

  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

17 entries across 17 versions & 1 rubygems

Version Path
nanoc-3.6.1 test/helpers/test_text.rb
nanoc-3.6.0 test/helpers/test_text.rb
nanoc-3.5.0 test/helpers/test_text.rb
nanoc-3.5.0b2 test/helpers/test_text.rb
nanoc-3.5.0b1 test/helpers/test_text.rb
nanoc-3.4.3 test/helpers/test_text.rb
nanoc-3.4.2 test/helpers/test_text.rb
nanoc-3.4.1 test/helpers/test_text.rb
nanoc-3.4.0 test/helpers/test_text.rb
nanoc-3.3.7 test/helpers/test_text.rb
nanoc-3.3.6 test/helpers/test_text.rb
nanoc-3.3.5 test/helpers/test_text.rb
nanoc-3.3.4 test/helpers/test_text.rb
nanoc-3.3.3 test/helpers/test_text.rb
nanoc-3.3.2 test/helpers/test_text.rb
nanoc-3.3.1 test/helpers/test_text.rb
nanoc-3.3.0 test/helpers/test_text.rb