Sha256: 6805e666fb418343db1ca81033bb852d570c0972bcdac1719d86c4a0f1602547

Contents?: true

Size: 751 Bytes

Versions: 4

Compression:

Stored size: 751 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

module ChhMoretext
  class Base
    class << self
      WORD = "測"

      def fetch_moretext(number, limit)
        limit = 1 unless limit != nil
        [WORD * limit] * number
      end
    end
  end
end

class TestMoretext < Test::Unit::TestCase
  def setup
    @tester = ChhMoretext::Moretext
  end

  def test_sentence
    assert @tester.sentence(5) == ["測測測測測"]
  end

  def test_sentences
    assert @tester.sentences(2, 5) == "測測測測測測測測測測"
  end

  def test_paragraph
    assert @tester.paragraph(5) == "測測測測測"
  end

  def test_paragraphs
    assert @tester.paragraphs(3) == "測測測\r\n\r\n測測測\r\n\r\n測測測"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chh_moretext-0.1.7 test/test_moretext.rb
chh_moretext-0.1.6 test/test_moretext.rb
chh_moretext-0.1.5 test/test_moretext.rb
chh_moretext-0.1.4 test/test_moretext.rb