File: test_faker_hacker_talk.rb

package info (click to toggle)
ruby-faker 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,596 kB
  • sloc: ruby: 20,656; sh: 6; makefile: 6
file content (37 lines) | stat: -rw-r--r-- 662 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerHacker < Test::Unit::TestCase
  def setup
    @hacker = Faker::Hacker
    @phrases = @hacker.phrases
  end

  def test_phrases
    assert_equal(8, @phrases.size)
    @phrases.each do |phrase|
      refute_empty phrase.to_s
    end
  end

  def test_noun
    assert_match(/\w+/, @hacker.noun)
  end

  def test_abbreviation
    assert_match(/\w+/, @hacker.abbreviation)
  end

  def test_adjective
    assert_match(/\w+/, @hacker.adjective)
  end

  def test_verb
    assert_match(/\w+/, @hacker.verb)
  end

  def test_ingverb
    assert_match(/\w+/, @hacker.ingverb)
  end
end