Sha256: f6534ad63b755f0fbdebf81dd4388a616f7e124cd2feb6ae3463e55c0da88742

Contents?: true

Size: 867 Bytes

Versions: 9

Compression:

Stored size: 867 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'

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

  TEST_REGEX = /\+1|[a-z]+/i.freeze

  assert_methods_are_deterministic(
    FFakerTW::CheesyLingo,
    :title, :word, :words, :sentence, :paragraph
  )

  def setup
    @tester = FFakerTW::CheesyLingo
  end

  def test_title
    assert_match(TEST_REGEX, @tester.title)
  end

  def test_word
    assert_match(TEST_REGEX, @tester.word)
  end

  def test_words
    assert_match(TEST_REGEX, @tester.words(3).join(' '))
  end

  def test_sentence
    assert_match(TEST_REGEX, @tester.sentence)
    assert_match(/1\+|[ a-zA-Z]+./, @tester.sentence)
  end

  def test_paragraph
    assert_match(/\+|[a-zA-Z]*./, @tester.paragraph(1))
  end

  def test_paragraph_with_arg
    assert_match(/\+1|[a-zA-Z]+./, @tester.paragraph(3))
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffakerTW-1.8.0 test/test_cheesy_lingo.rb
ffakerTW-1.7.0 test/test_cheesy_lingo.rb
ffakerTW-1.6.0 test/test_cheesy_lingo.rb
ffakerTW-1.5.0 test/test_cheesy_lingo.rb
ffakerTW-1.4.0 test/test_cheesy_lingo.rb
ffakerTW-1.3.0 test/test_cheesy_lingo.rb
ffakerTW-1.2.0 test/test_cheesy_lingo.rb
ffakerTW-1.1.0 test/test_cheesy_lingo.rb
ffakerTW-0.1.0 test/test_cheesy_lingo.rb