Sha256: a55e497ec25c41e749f77cbc3697941f0e563275687b0687a23f3fd20870272e

Contents?: true

Size: 794 Bytes

Versions: 8

Compression:

Stored size: 794 Bytes

Contents

require 'test_helper'
require 'review/textutils'

class TextUtilsTest < Test::Unit::TestCase
  include ReVIEW::TextUtils

  def setup
    @tu_nil = Object.new
    @tu_nil.extend ReVIEW::TextUtils
    def @tu_nil.pre_paragraph;nil;end
    def @tu_nil.post_paragraph;nil;end

    @tu_p = Object.new
    @tu_p.extend ReVIEW::TextUtils
    def @tu_p.pre_paragraph;'<p>';end
    def @tu_p.post_paragraph;'</p>';end
  end

  def test_detab
    detabed = detab("\t\tabc")
    assert_equal "                abc", detabed
    detabed = detab("\tabc\tbcd")
    assert_equal "        abc     bcd", detabed
  end

  def test_detab_with_arg
    detabed = detab("\t\tabcd\tef",2)
    assert_equal "    abcd  ef", detabed
    detabed = detab("\tabc\tdef", 4)
    assert_equal "    abc def", detabed
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
review-peg-0.2.2 test/test_textutils.rb
review-peg-0.2.1 test/test_textutils.rb
review-peg-0.2.0 test/test_textutils.rb
review-peg-0.1.3 test/test_textutils.rb
review-peg-0.1.2 test/test_textutils.rb
review-peg-0.1.1 test/test_textutils.rb
review-peg-0.1.0 test/test_textutils.rb
review-2.0.0.beta1 test/test_textutils.rb