ffaker 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +32 -0
  3. data/README.md +7 -6
  4. data/REFERENCE.md +1355 -0
  5. data/Rakefile +6 -6
  6. data/ffaker.gemspec +16 -3
  7. data/lib/ffaker.rb +1 -1
  8. data/lib/ffaker/address_ca.rb +3 -3
  9. data/lib/ffaker/avatar.rb +20 -0
  10. data/lib/ffaker/bacon_ipsum.rb +1 -1
  11. data/lib/ffaker/data/job_cn/job_nouns +300 -0
  12. data/lib/ffaker/data/sport/names +34 -0
  13. data/lib/ffaker/dizzle_ipsum.rb +1 -1
  14. data/lib/ffaker/healthcare_ipsum.rb +1 -1
  15. data/lib/ffaker/hipster_ipsum.rb +1 -1
  16. data/lib/ffaker/html_ipsum.rb +1 -1
  17. data/lib/ffaker/identification_kr.rb +20 -0
  18. data/lib/ffaker/identification_mx.rb +3 -3
  19. data/lib/ffaker/internet.rb +3 -3
  20. data/lib/ffaker/internet_se.rb +1 -1
  21. data/lib/ffaker/job_cn.rb +12 -0
  22. data/lib/ffaker/job_fr.rb +6 -2
  23. data/lib/ffaker/locale.rb +1 -1
  24. data/lib/ffaker/lorem.rb +7 -5
  25. data/lib/ffaker/lorem_ar.rb +1 -1
  26. data/lib/ffaker/lorem_cn.rb +1 -1
  27. data/lib/ffaker/lorem_fr.rb +1 -1
  28. data/lib/ffaker/lorem_kr.rb +1 -1
  29. data/lib/ffaker/movie.rb +6 -0
  30. data/lib/ffaker/phone_number.rb +46 -17
  31. data/lib/ffaker/product.rb +1 -1
  32. data/lib/ffaker/skill.rb +1 -1
  33. data/lib/ffaker/sport.rb +10 -0
  34. data/lib/ffaker/string.rb +22 -11
  35. data/lib/ffaker/utils/array_utils.rb +4 -3
  36. data/lib/ffaker/vehicle.rb +1 -1
  37. data/scripts/reference.rb +89 -0
  38. data/test/test_address_ca.rb +6 -4
  39. data/test/test_array_utils.rb +3 -3
  40. data/test/test_avatar.rb +50 -0
  41. data/test/test_company.rb +8 -6
  42. data/test/test_identification.rb +5 -4
  43. data/test/test_identification_kr.rb +13 -0
  44. data/test/test_internet.rb +4 -0
  45. data/test/test_job.rb +1 -2
  46. data/test/test_job_cn.rb +17 -0
  47. data/test/test_job_fr.rb +4 -7
  48. data/test/test_job_ja.rb +1 -1
  49. data/test/test_job_kr.rb +1 -1
  50. data/test/test_locale.rb +21 -0
  51. data/test/test_lorem_kr.rb +1 -1
  52. data/test/test_movie.rb +8 -0
  53. data/test/test_name.rb +3 -3
  54. data/test/test_name_br.rb +7 -8
  55. data/test/test_name_cs.rb +8 -6
  56. data/test/test_name_de.rb +3 -3
  57. data/test/test_name_fr.rb +15 -17
  58. data/test/test_name_ga.rb +12 -14
  59. data/test/test_name_it.rb +14 -15
  60. data/test/test_name_ja.rb +1 -1
  61. data/test/test_name_mx.rb +82 -80
  62. data/test/test_name_nb.rb +6 -9
  63. data/test/test_name_nl.rb +3 -3
  64. data/test/test_name_ph.rb +12 -2
  65. data/test/test_name_ru.rb +14 -10
  66. data/test/test_name_se.rb +6 -9
  67. data/test/test_name_sn.rb +39 -52
  68. data/test/test_name_th.rb +7 -9
  69. data/test/test_phone_number.rb +9 -0
  70. data/test/test_sports.rb +13 -0
  71. data/test/test_string.rb +26 -16
  72. data/test/test_units.rb +8 -10
  73. data/test/test_units_english.rb +15 -22
  74. data/test/test_units_metric.rb +15 -21
  75. metadata +22 -4
@@ -3,36 +3,33 @@
3
3
  require 'helper'
4
4
 
5
5
  class TestFakerNameNB < Test::Unit::TestCase
6
-
7
6
  def setup
8
7
  @tester = FFaker::NameNB
9
8
  end
10
9
 
11
10
  def test_last_name
12
- assert FFaker::NameNB::LAST_NAMES.include?(@tester.last_name)
11
+ assert_include @tester::LAST_NAMES, @tester.last_name
13
12
  end
14
13
 
15
14
  def test_first_name_male
16
- assert FFaker::NameNB::FIRST_NAMES_MALE.include?(@tester.first_name_male)
15
+ assert_include @tester::FIRST_NAMES_MALE, @tester.first_name_male
17
16
  end
18
17
 
19
18
  def test_first_name_female
20
- assert FFaker::NameNB::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
19
+ assert_include @tester::FIRST_NAMES_FEMALE, @tester.first_name_female
21
20
  end
22
21
 
23
22
  def test_prefix
24
- assert FFaker::NameNB::PREFIXES.include?(@tester.prefix)
23
+ assert_include @tester::PREFIXES, @tester.prefix
25
24
  end
26
25
 
27
26
  def test_first_name
28
27
  parts = @tester.first_name.split(' ')
29
- assert [1,2].include? parts.count
28
+ assert_include [1, 2], parts.count
30
29
  end
31
30
 
32
31
  def test_name
33
32
  parts = @tester.name.split(' ')
34
- assert [2, 3, 4].include? parts.count
33
+ assert_include [2, 3, 4], parts.count
35
34
  end
36
-
37
35
  end
38
-
@@ -8,14 +8,14 @@ class TestFakerNameNL < Test::Unit::TestCase
8
8
  end
9
9
 
10
10
  def test_name
11
- assert @tester.name.match(/(\w+\.? ?){2,3}/)
11
+ assert_match(/(\w+\.? ?){2,3}/, @tester.name)
12
12
  end
13
13
 
14
14
  def test_prefix
15
- assert @tester.prefix.match(/[A-Z][a-z]+\.?/)
15
+ assert_match(/[A-Z][a-z]+\.?/, @tester.prefix)
16
16
  end
17
17
 
18
18
  def test_suffix
19
- assert @tester.suffix.match(/[A-Z][a-z]*\.?/)
19
+ assert_match(/[A-Z][a-z]*\.?/, @tester.suffix)
20
20
  end
21
21
  end
@@ -3,15 +3,25 @@
3
3
  require 'helper'
4
4
 
5
5
  class TestFakerNamePH < Test::Unit::TestCase
6
+ PH_REGEXP = /\A([\wñÑú-]+\.? ?){2,5}\z/
7
+
6
8
  def setup
7
9
  @tester = FFaker::NamePH
8
10
  end
9
11
 
10
12
  def test_name
11
- assert @tester.name.match(/(\w+\.? ?){2,3}/)
13
+ assert_match(PH_REGEXP, @tester.name)
14
+ end
15
+
16
+ def test_last_name
17
+ assert_match(PH_REGEXP, @tester.last_name)
18
+ end
19
+
20
+ def test_first_name
21
+ assert_match(PH_REGEXP, @tester.first_name)
12
22
  end
13
23
 
14
24
  def test_prefix
15
- assert @tester.prefix.match(/[A-Z][a-z]+\.?/)
25
+ assert_match(/\A[A-Z][a-z]+\.?\z/, @tester.prefix)
16
26
  end
17
27
  end
@@ -2,15 +2,17 @@
2
2
 
3
3
  require 'helper'
4
4
 
5
- class TestFakerNameRu < Test::Unit::TestCase
5
+ class TestFakerNameRU < Test::Unit::TestCase
6
+ RU_REGEX = /[А-Я][а-я]+/
7
+
6
8
  def setup
7
9
  @tester = FFaker::NameRU
8
10
  end
9
11
 
10
12
  def test_name
11
13
  @words = @tester.name.split
12
- assert [2,3].include?(@words.size)
13
- assert @words.each { |word| word.match /[А-Я][а-я]+/ }
14
+ assert_include [2, 3], @words.size
15
+ assert @words.all? { |word| word.match RU_REGEX }
14
16
  end
15
17
 
16
18
  def test_name_sex
@@ -19,27 +21,27 @@ class TestFakerNameRu < Test::Unit::TestCase
19
21
  end
20
22
 
21
23
  def test_last_name
22
- assert @tester.last_name.match(/[А-Я][а-я]+/)
24
+ assert_match RU_REGEX, @tester.last_name
23
25
  end
24
26
 
25
27
  def test_male_last_name
26
- assert FFaker::NameRU::LAST_NAMES[:male].include?(@tester.last_name(:male))
28
+ assert_include @tester::LAST_NAMES[:male], @tester.last_name(:male)
27
29
  end
28
30
 
29
31
  def test_first_name
30
- assert @tester.first_name.match(/[А-Я][а-я]+/)
32
+ assert_match RU_REGEX, @tester.first_name
31
33
  end
32
34
 
33
35
  def test_male_first_name
34
- assert FFaker::NameRU::FIRST_NAMES[:male].include?(@tester.first_name(:male))
36
+ assert_include @tester::FIRST_NAMES[:male], @tester.first_name(:male)
35
37
  end
36
38
 
37
39
  def test_patronymic
38
- assert @tester.patronymic.match(/[А-Я][а-я]+/)
40
+ assert_match RU_REGEX, @tester.patronymic
39
41
  end
40
42
 
41
43
  def test_male_patronymic
42
- assert FFaker::NameRU::PATRONYMICS[:male].include?(@tester.patronymic(:male))
44
+ assert_include @tester::PATRONYMICS[:male], @tester.patronymic(:male)
43
45
  end
44
46
 
45
47
  def test_with_same_sex
@@ -62,11 +64,13 @@ class TestFakerNameRu < Test::Unit::TestCase
62
64
  assert same_sex?(names, :male)
63
65
  end
64
66
 
67
+ private
68
+
65
69
  # checks if every name is of the same sex
66
70
  def same_sex?(words, sex = :any)
67
71
  (sex == :any ? [:male, :female] : [sex]).any? do |sex|
68
72
  words.all? do |word|
69
- [FFaker::NameRU::LAST_NAMES, FFaker::NameRU::FIRST_NAMES, FFaker::NameRU::PATRONYMICS].any? do |names|
73
+ [@tester::LAST_NAMES, @tester::FIRST_NAMES, @tester::PATRONYMICS].any? do |names|
70
74
  names[sex].include?(word)
71
75
  end
72
76
  end
@@ -3,36 +3,33 @@
3
3
  require 'helper'
4
4
 
5
5
  class TestFakerNameSE < Test::Unit::TestCase
6
-
7
6
  def setup
8
7
  @tester = FFaker::NameSE
9
8
  end
10
9
 
11
10
  def test_last_name
12
- assert FFaker::NameSE::LAST_NAMES.include?(@tester.last_name)
11
+ assert_include @tester::LAST_NAMES, (@tester.last_name)
13
12
  end
14
13
 
15
14
  def test_first_name_male
16
- assert FFaker::NameSE::FIRST_NAMES_MALE.include?(@tester.first_name_male)
15
+ assert_include @tester::FIRST_NAMES_MALE, (@tester.first_name_male)
17
16
  end
18
17
 
19
18
  def test_first_name_female
20
- assert FFaker::NameSE::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
19
+ assert_include @tester::FIRST_NAMES_FEMALE, (@tester.first_name_female)
21
20
  end
22
21
 
23
22
  def test_prefix
24
- assert FFaker::NameSE::PREFIXES.include?(@tester.prefix)
23
+ assert_include @tester::PREFIXES, (@tester.prefix)
25
24
  end
26
25
 
27
26
  def test_first_name
28
27
  parts = @tester.first_name.split(' ')
29
- assert [1,2].include? parts.count
28
+ assert_include [1, 2], parts.count
30
29
  end
31
30
 
32
31
  def test_name
33
32
  parts = @tester.name.split(' ')
34
- assert [2, 3, 4].include? parts.count
33
+ assert_include [2, 3, 4], parts.count
35
34
  end
36
-
37
35
  end
38
-
@@ -4,95 +4,82 @@ require 'helper'
4
4
 
5
5
  # Author: PapePathe<pathe.sene@gmail.com> github.com/PapePathe
6
6
  class TestFakerNameSn < Test::Unit::TestCase
7
-
8
7
  def setup
9
8
  @tester = FFaker::NameSN
10
9
  end
11
10
 
12
11
  def test_last_name
13
- assert FFaker::NameSN::LAST_NAMES.include?(@tester.last_name)
12
+ assert_include @tester::LAST_NAMES, @tester.last_name
14
13
  end
15
14
 
16
15
  def test_first_name_male
17
- assert FFaker::NameSN::FIRST_NAMES_MALE.include?(@tester.first_name_male)
16
+ assert_include @tester::FIRST_NAMES_MALE, @tester.first_name_male
18
17
  end
19
18
 
20
19
  def test_first_name_female
21
- assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(@tester.first_name_female)
20
+ assert_include @tester::FIRST_NAMES_FEMALE, @tester.first_name_female
22
21
  end
23
22
 
24
23
  def test_prefix_male
25
- assert FFaker::NameSN::PREFIX_MALE.include?(@tester.prefix_male)
24
+ assert_include @tester::PREFIX_MALE, @tester.prefix_male
26
25
  end
27
26
 
28
27
  def test_prefix_female
29
- assert FFaker::NameSN::PREFIX_FEMALE.include?(@tester.prefix_female)
28
+ assert_include @tester::PREFIX_FEMALE, @tester.prefix_female
30
29
  end
31
30
 
32
31
  def test_name_male
33
- # => split the name_male into an array of words
34
32
  parts = @tester.name_male.split(' ')
33
+ assert_include [2, 3], parts.count
35
34
 
36
- if parts.count == 3
37
- # the value at the index 0 should be a valid! male_prefix
38
- assert FFaker::NameSN::PREFIX_MALE.include?(parts[0])
39
-
40
- # the value at the index 1 should be a valid! male_first_name
41
- assert FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[1])
35
+ case parts.count
36
+ when 3
37
+ male_prefix, male_first_name, last_name = parts
42
38
 
43
- # the value at the index 2 should be a valid! last_name
44
- assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
39
+ assert_include @tester::PREFIX_MALE, male_prefix
40
+ assert_include @tester::FIRST_NAMES_MALE, male_first_name
41
+ assert_include @tester::LAST_NAMES, last_name
42
+ when 2
43
+ male_first_name, last_name = parts
45
44
 
46
- elsif parts.count == 2
47
- # the value at the index 0 should be a valid! male_prefix
48
- assert FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[0])
49
-
50
- # the value at the index 1 should be a valid! last_name
51
- assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
45
+ assert_include @tester::FIRST_NAMES_MALE, male_first_name
46
+ assert_include @tester::LAST_NAMES, last_name
52
47
  end
53
48
  end
54
49
 
55
50
  def test_name_female
56
- # => split the name_female into an array of words
57
51
  parts = @tester.name_female.split(' ')
52
+ assert_include [2, 3], parts.count
58
53
 
59
- if parts.count == 3
60
- # the value at the index 0 should be a valid! male_prefix
61
- assert FFaker::NameSN::PREFIX_FEMALE.include?(parts[0])
62
-
63
- # the value at the index 1 should be a valid! male_first_name
64
- assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[1])
54
+ case parts.count
55
+ when 3
56
+ female_prefix, female_first_name, last_name = parts
65
57
 
66
- # the value at the index 2 should be a valid! last_name
67
- assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
68
- elsif parts.count == 2
69
- # the value at the index 0 should be a valid! male_prefix
70
- assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[0])
58
+ assert_include @tester::PREFIX_FEMALE, female_prefix
59
+ assert_include @tester::FIRST_NAMES_FEMALE, female_first_name
60
+ assert_include @tester::LAST_NAMES, last_name
61
+ when 2
62
+ female_first_name, last_name = parts
71
63
 
72
- # the value at the index 1 should be a valid! last_name
73
- assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
64
+ assert_include @tester::FIRST_NAMES_FEMALE, female_first_name
65
+ assert_include @tester::LAST_NAMES, last_name
74
66
  end
75
67
  end
76
68
 
77
69
  def test_senegalese_name
78
- # => split the name into an array of words
79
70
  parts = @tester.name_sn.split(' ')
80
-
81
- if parts.count == 3
82
- # the value at the index 0 should be a valid! male or female prefix
83
- assert FFaker::NameSN::PREFIX_FEMALE.include?(parts[0]) || FFaker::NameSN::PREFIX_MALE.include?(parts[0])
84
-
85
- # the value at the index 1 should be a valid! firstname male or female
86
- assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[1]) || FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[1])
87
-
88
- # the value at the index 2 should be a valid! firstname male or female
89
- assert FFaker::NameSN::LAST_NAMES.include?(parts[2])
90
- elsif parts.count == 2
91
- # the value at the index 0 should be a valid! firstname male or female
92
- assert FFaker::NameSN::FIRST_NAMES_FEMALE.include?(parts[0]) || FFaker::NameSN::FIRST_NAMES_MALE.include?(parts[0])
93
-
94
- # the value at the index 0 should be a valid! firstname male or female
95
- assert FFaker::NameSN::LAST_NAMES.include?(parts[1])
71
+ assert_include [2, 3], parts.count
72
+
73
+ case parts.count
74
+ when 3
75
+ prefix, first_name, last_name = parts
76
+ assert_include(@tester::PREFIX_FEMALE + @tester::PREFIX_MALE, prefix)
77
+ assert_include(@tester::FIRST_NAMES_FEMALE + @tester::FIRST_NAMES_MALE, first_name)
78
+ assert_include @tester::LAST_NAMES, last_name
79
+ when 2
80
+ first_name, last_name = parts
81
+ assert_include(@tester::FIRST_NAMES_FEMALE + @tester::FIRST_NAMES_MALE, first_name)
82
+ assert_include @tester::LAST_NAMES, last_name
96
83
  end
97
84
  end
98
85
  end
@@ -3,27 +3,25 @@
3
3
  require 'helper'
4
4
 
5
5
  class TestFakerNameTH < Test::Unit::TestCase
6
-
7
6
  def setup
8
7
  @tester = FFaker::NameTH
9
8
  end
10
9
 
11
10
  def test_last_name
12
- assert FFaker::NameTH::LAST_NAMES.include?(@tester.last_name)
11
+ assert_include @tester::LAST_NAMES, @tester.last_name
13
12
  end
14
13
 
15
14
  def test_first_name
16
- assert FFaker::NameTH::FIRST_NAMES.include?(@tester.first_name)
15
+ assert_include @tester::FIRST_NAMES, @tester.first_name
17
16
  end
18
17
 
19
18
  def test_nick_name
20
- assert FFaker::NameTH::NICK_NAMES.include?(@tester.nick_name)
19
+ assert_include @tester::NICK_NAMES, @tester.nick_name
21
20
  end
22
21
 
23
22
  def test_name
24
- parts = @tester.name.split(' ')
25
- assert FFaker::NameTH::FIRST_NAMES.include?(parts[0])
26
- assert FFaker::NameTH::LAST_NAMES.include?(parts[1])
23
+ first_name, last_name = @tester.name.split(' ')
24
+ assert_include @tester::FIRST_NAMES, first_name
25
+ assert_include @tester::LAST_NAMES, last_name
27
26
  end
28
-
29
- end
27
+ end
@@ -10,4 +10,13 @@ class TestPhoneNumer < Test::Unit::TestCase
10
10
  def test_short_phone_number
11
11
  assert_match /\d{3}-\d{3}-\d{4}/, FFaker::PhoneNumber.short_phone_number
12
12
  end
13
+
14
+ def test_imei
15
+ assert_match /^\d{15}$/, FFaker::PhoneNumber.imei
16
+ end
17
+
18
+ def test_imei_with_sn
19
+ sn = rand(1_000_000)
20
+ assert_match /^\d{8}#{sprintf('%06d', sn)}\d{1}$/, FFaker::PhoneNumber.imei(sn)
21
+ end
13
22
  end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+
3
+ require 'helper'
4
+
5
+ class TestSports < Test::Unit::TestCase
6
+ def setup
7
+ @tester = FFaker::Sport
8
+ end
9
+
10
+ def test_name
11
+ assert_include @tester::NAMES, @tester.name
12
+ end
13
+ end
@@ -6,66 +6,76 @@ class TestString < Test::Unit::TestCase
6
6
  FS = FFaker::String
7
7
 
8
8
  def test_atoms
9
- assert_equal "abc", FS.from_regexp(/abc/)
9
+ assert_equal 'abc', FS.from_regexp(/abc/)
10
10
  end
11
11
 
12
12
  def test_digits
13
- assert_match /\d\d\d/, FS.from_regexp(/\d\d\d/)
13
+ assert_match(/\A\d\d\d\z/, FS.from_regexp(/\d\d\d/))
14
14
  end
15
15
 
16
16
  def test_word_characters
17
- assert_match /\w\w\w/, FS.from_regexp(/\w\w\w/)
17
+ assert_match(/\A\w\w\w\z/, FS.from_regexp(/\w\w\w/))
18
+ end
19
+
20
+ def test_word_range_character
21
+ assert_match(/\A[a-z]\z/, FS.from_regexp(/[a-z]/))
22
+ end
23
+
24
+ def test_dash_character
25
+ assert_match(/\A[a-z-]\z/, FS.from_regexp(/[a-z-]/))
26
+ assert_match(/\A[a-]\z/, FS.from_regexp(/[a-]/))
27
+ assert_match(/\A[-]\z/, FS.from_regexp(/[-]/))
18
28
  end
19
29
 
20
30
  def test_spaces
21
- assert_match /\s\s\s/, FS.from_regexp(/\s\s\s/)
31
+ assert_match(/\A\s\s\s\z/, FS.from_regexp(/\s\s\s/))
22
32
  end
23
33
 
24
34
  def test_escaped_characters
25
- assert_equal "\\/.()[]{}", FS.from_regexp(/\\\/\.\(\)\[\]\{\}/)
35
+ assert_equal '\\/.()[]{}', FS.from_regexp(/\\\/\.\(\)\[\]\{\}/)
26
36
  end
27
37
 
28
38
  def test_atom_sets
29
- assert ['a', 'b', 'c'].include?(FS.from_regexp(/[abc]/))
39
+ assert_include %w(a b c), FS.from_regexp(/[abc]/)
30
40
  end
31
41
 
32
42
  def test_special_sets
33
- assert_match /[\w\d]/, FS.from_regexp(/[\w\d]/)
43
+ assert_match(/\A[\w\d]\z/, FS.from_regexp(/[\w\d]/))
34
44
  end
35
45
 
36
46
  def test_atom_question
37
- assert_match /a?/, FS.from_regexp(/a?/)
47
+ assert_match(/\Aa?\z/, FS.from_regexp(/a?/))
38
48
  end
39
49
 
40
50
  def test_special_question
41
- assert_match /^\w?$/, FS.from_regexp(/\w?/)
51
+ assert_match(/\A\w?\z/, FS.from_regexp(/\w?/))
42
52
  end
43
53
 
44
54
  def test_set_question
45
- assert_match /^[abc]?$/, FS.from_regexp(/[abc]?/)
55
+ assert_match(/\A[abc]?\z/, FS.from_regexp(/[abc]?/))
46
56
  end
47
57
 
48
58
  def test_atom_plus
49
- assert_match /a+/, FS.from_regexp(/a+/)
59
+ assert_match(/\Aa+\z/, FS.from_regexp(/a+/))
50
60
  end
51
61
 
52
62
  def test_special_plus
53
- assert_match /\w+/, FS.from_regexp(/\w+/)
63
+ assert_match(/\A\w+\z/, FS.from_regexp(/\w+/))
54
64
  end
55
65
 
56
66
  def test_set_plus
57
- assert_match /^[abc]+$/, FS.from_regexp(/[abc]+/)
67
+ assert_match(/\A[abc]+\z/, FS.from_regexp(/[abc]+/))
58
68
  end
59
69
 
60
70
  def test_atom_star
61
- assert_match /a*/, FS.from_regexp(/a*/)
71
+ assert_match(/\Aa*\z/, FS.from_regexp(/a*/))
62
72
  end
63
73
 
64
74
  def test_special_star
65
- assert_match /\w*/, FS.from_regexp(/\w*/)
75
+ assert_match(/\A\w*\z/, FS.from_regexp(/\w*/))
66
76
  end
67
77
 
68
78
  def test_set_star
69
- assert_match /^[abc]*$/, FS.from_regexp(/[abc]*/)
79
+ assert_match(/\A[abc]*\z/, FS.from_regexp(/[abc]*/))
70
80
  end
71
81
  end