public Method

TestText__Format.test_splendiferous

There's no documentation for this item.

Source Code

# File action_mailer/vendor/text-format-0.6.3/text/format.rb, line 1435
def test_splendiferous
  h = nil
  test = "This is a splendiferous test"
  assert_nothing_raised { @format_o = Text::Format.new(:columns => 6, :left_margin => 0, :indent => 0, :first_indent => 0) }
  assert_match(/^splendiferous$/, @format_o.format(test))
  assert_nothing_raised { @format_o.hard_margins = true }
  assert_match(/^lendif$/, @format_o.format(test))
  assert_nothing_raised { h = Object.new }
  assert_nothing_raised do
    @format_o.split_rules = Text::Format::SPLIT_HYPHENATION
    class << h #:nodoc:
      def hyphenate_to(word, size)
        return ["", word] if size < 2
        [word[0 ... size], word[size .. -1]]
      end
    end
    @format_o.hyphenator = h
  end
  assert_match(/^iferou$/, @format_o.format(test))
  assert_nothing_raised { h = Object.new }
  assert_nothing_raised do
    class << h #:nodoc:
      def hyphenate_to(word, size, formatter)
        return ["", word] if word.size < formatter.columns
        [word[0 ... size], word[size .. -1]]
      end
    end
    @format_o.hyphenator = h
  end
  assert_match(/^ferous$/, @format_o.format(test))
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.