Sha256: b2049d8a1b068cc4ed3d7279748286df60749460130c5220f8549cf21006d176

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require_relative 'helper'

class TestLoremFR < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFakerTW::LoremFR,
    :paragraph, :paragraphs, :sentence, :sentences, :phrase, :phrases, :word, :words
  )

  REGEX = /\A[ -.ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i.freeze
  REGEX_WORD = /\A[-ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i.freeze
  REGEX_WORDS = /\A[ -ÀÂÉÈÊÎÔÚÛàâéèêîôùûa-z]+\z/i.freeze

  def test_paragraph
    assert_match(REGEX, FFakerTW::LoremFR.paragraph)
  end

  def test_sentence
    assert_match(REGEX, FFakerTW::LoremFR.sentence)
  end

  def test_phrase
    assert_match(REGEX, FFakerTW::LoremFR.phrase)
  end

  def test_paragraphs
    assert_match(REGEX, FFakerTW::LoremFR.paragraphs.join(' '))
  end

  def test_sentences
    assert_match(REGEX, FFakerTW::LoremFR.sentences.join(' '))
  end

  def test_phrases
    assert_match(REGEX, FFakerTW::LoremFR.phrases.join(' '))
  end

  def test_words
    assert_match(REGEX_WORDS, FFakerTW::LoremFR.words.join(' '))
  end

  def test_word
    assert_match(REGEX_WORD, FFakerTW::LoremFR.word)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 test/test_lorem_fr.rb