phony 2.15.49 → 2.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2d261312b89cd2670ec6b20a58f8464b85a3371
4
- data.tar.gz: 7f2e0bdf26ec96c440b77caac7db75ef00f2c4d1
3
+ metadata.gz: d831c513f17ed24daad1ad6bd38a46c6b37deb16
4
+ data.tar.gz: 304941e9a21b1947471bcf3f2fc6de9dc5294ce7
5
5
  SHA512:
6
- metadata.gz: 88dcbcfac2df06d7692787ac8781d87b94e8ebc24f838b7ee9717a4c6030f90e3522e3e7476afde083c46d69557d55fc7c76592ad8fdd2d065a43db4ac30de6f
7
- data.tar.gz: 9515d295a853c699c1301266ad54b7e529a02f64d097b5517eda3e80df38c824256a9c52fb92894793a6783e44c091aa94d89f376bd46bf7c24feb8eaa485e66
6
+ metadata.gz: 04743bc50ad6da4c0936878ed2a9eb4b2e560de7e36622e41e741da77a7ddd9e1d9f3893db71113045e68217a69ed71ca5c441b29f47d7f7c69562a910de1ff8
7
+ data.tar.gz: 00dc3f70d706c77aa3d31df5306491d01bf1aefd2cb79bc78ef1977ab15b6184d27f470723b7e3254754e727c3b1c831b300bd65a9b302e717456bc95da32578
@@ -76,9 +76,31 @@ module Phony
76
76
  # @example
77
77
  # Phony.normalize("Fnork!") # Raises a Phony::NormalizationError.
78
78
  #
79
- class NormalizationError < StandardError
80
- def initialize(input)
81
- super %Q{Phony could not normalize the given number. Is #{input.inspect} a phone number?}
79
+ class NormalizationError < ArgumentError
80
+ def initialize
81
+ super %Q{Phony could not normalize the given number. Is it a phone number?}
82
+ end
83
+ end
84
+
85
+ # Raised in case Phony can't split a given number.
86
+ #
87
+ # @example
88
+ # Phony.split("Fnork!") # Raises a Phony::SplittingError.
89
+ #
90
+ class SplittingError < ArgumentError
91
+ def initialize number
92
+ super %Q{Phony could not split the given number. Is #{number.blank? ? 'it' : number.inspect} a phone number?}
93
+ end
94
+ end
95
+
96
+ # Raised in case Phony can't format a given number.
97
+ #
98
+ # @example
99
+ # Phony.format("Fnork!") # Raises a Phony::FormattingError.
100
+ #
101
+ class FormattingError < ArgumentError
102
+ def initialize
103
+ super %Q{Phony could not format the given number. Is it a phone number?}
82
104
  end
83
105
  end
84
106
 
@@ -121,6 +143,7 @@ module Phony
121
143
  #
122
144
  def normalize phone_number, options = {}
123
145
  raise ArgumentError, "Phone number cannot be nil. Use e.g. number && Phony.normalize(number)." unless phone_number
146
+
124
147
  normalize! phone_number.dup, options
125
148
  end
126
149
  # A destructive version of {#normalize}.
@@ -143,7 +166,7 @@ module Phony
143
166
  def normalize! phone_number, options = {}
144
167
  @codes.normalize phone_number, options
145
168
  rescue
146
- raise NormalizationError.new phone_number
169
+ raise NormalizationError.new
147
170
  end
148
171
 
149
172
  # Splits the phone number into pieces according to the country codes.
@@ -162,7 +185,8 @@ module Phony
162
185
  #
163
186
  def split phone_number
164
187
  raise ArgumentError, "Phone number cannot be nil. Use e.g. number && Phony.split(number)." unless phone_number
165
- split! phone_number.dup
188
+
189
+ split! phone_number.dup, phone_number
166
190
  end
167
191
  # A destructive version of {#split}.
168
192
  #
@@ -178,8 +202,11 @@ module Phony
178
202
  # @example Split a NANP number.
179
203
  # Phony.split!("13015550100") # => ["1", "301", "555", "0100"]
180
204
  #
181
- def split! phone_number
205
+ def split! phone_number, error_number = nil
182
206
  @codes.split phone_number
207
+ rescue
208
+ # NB The error_number (reference) is used because phone_number is destructively handled.
209
+ raise SplittingError.new(error_number)
183
210
  end
184
211
 
185
212
  # Formats a normalized E164 number according to a country's formatting scheme.
@@ -231,6 +258,8 @@ module Phony
231
258
  #
232
259
  def format! phone_number, options = {}
233
260
  @codes.format phone_number, options
261
+ rescue
262
+ raise FormattingError.new
234
263
  end
235
264
  alias formatted format
236
265
  alias formatted! format!
@@ -34,7 +34,8 @@ Phony.define do
34
34
  match(/\A(81\d|82\d|83\d|84\d|85\d|86\d|87\d|88\d|89\d)\d+\z/) >> matched_split( # mobile
35
35
  /\A\d{6}\z/ => [3,3],
36
36
  /\A\d{7}\z/ => [3,4],
37
- /\A\d+\z/ => [4,4]) |
37
+ /\A\d{8}\z/ => [4,4],
38
+ /\A\d+\z/ => [4,5]) |
38
39
  one_of(%w(9)) >> matched_split( # geographic
39
40
  /\A\d{7}\z/ => [4,3],
40
41
  /\A\d+\z/ => [3,3,3]) |
@@ -25,11 +25,11 @@ describe 'plausibility' do
25
25
  incorrect = [shortest.sub(/\d\s*\z/, '')] # , longest + '0']
26
26
 
27
27
  correct.each do |value|
28
- Phony.plausible?(value).should be_true,
28
+ Phony.plausible?(value).should be_truthy,
29
29
  "It should validate #{value}, but does not."
30
30
  end
31
31
  incorrect.each do |value|
32
- Phony.plausible?(value).should be_false,
32
+ Phony.plausible?(value).should be_falsey,
33
33
  "It should not validate #{value}, but does."
34
34
  end
35
35
  end
@@ -38,7 +38,7 @@ describe 'plausibility' do
38
38
  invalid = [*sample]
39
39
 
40
40
  invalid.each do |value|
41
- Phony.plausible?(value).should be_false,
41
+ Phony.plausible?(value).should be_falsey,
42
42
  "It should not validate #{value}, but does."
43
43
  end
44
44
  end
@@ -54,14 +54,14 @@ describe 'plausibility' do
54
54
  it_is_correct_for 'Cook Islands', :samples => '+682 71928'
55
55
  it_is_correct_for 'Costa Rica', :samples => '+506 2 234 5678'
56
56
  it 'is correct for Croatia' do
57
- Phony.plausible?('+385 21 695 900').should be_true # Landline
58
- Phony.plausible?('+385 1 4566 666').should be_true # Landline (Zagreb)
59
- Phony.plausible?('+385 99 444 999').should be_true # Mobile
60
- Phony.plausible?('+385 91 896 7509').should be_true # Mobile
61
- Phony.plausible?('+385 800 1234').should be_true # Toll free
62
- Phony.plausible?('+385 800 123 456').should be_true # Toll free
63
- Phony.plausible?('+385 60 12 345').should be_true # Premium rate
64
- Phony.plausible?('+385 62 123 456').should be_true # Premium, personal and UAN
57
+ Phony.plausible?('+385 21 695 900').should be_truthy # Landline
58
+ Phony.plausible?('+385 1 4566 666').should be_truthy # Landline (Zagreb)
59
+ Phony.plausible?('+385 99 444 999').should be_truthy # Mobile
60
+ Phony.plausible?('+385 91 896 7509').should be_truthy # Mobile
61
+ Phony.plausible?('+385 800 1234').should be_truthy # Toll free
62
+ Phony.plausible?('+385 800 123 456').should be_truthy # Toll free
63
+ Phony.plausible?('+385 60 12 345').should be_truthy # Premium rate
64
+ Phony.plausible?('+385 62 123 456').should be_truthy # Premium, personal and UAN
65
65
  end
66
66
  it_is_correct_for "Côte d'Ivoire", :samples => '+225 9358 8764'
67
67
  it_is_correct_for 'Democratic Republic of Timor-Leste', :samples => ['+670 465 7886', '+670 7465 7886']
@@ -69,30 +69,30 @@ describe 'plausibility' do
69
69
  it_is_correct_for 'Diego Garcia', :samples => '+246 123 7686'
70
70
  it_is_correct_for 'Djibouti', :samples => '+253 3671 1431'
71
71
  it 'is correct for Ecuador' do
72
- Phony.plausible?('+593 22 000 0000').should be_true
73
- Phony.plausible?('+593 23 000 0000').should be_true
74
- Phony.plausible?('+593 26 000 0000').should be_true
75
- Phony.plausible?('+593 27 000 0000').should be_true
76
- Phony.plausible?('+593 44 000 0000').should be_true
77
- Phony.plausible?('+593 45 000 0000').should be_true
78
- Phony.plausible?('+593 47 000 0000').should be_true
79
- Phony.plausible?('+593 2 200 0000').should be_true
80
- Phony.plausible?('+593 2 300 0000').should be_true
81
- Phony.plausible?('+593 2 400 0000').should be_true
82
- Phony.plausible?('+593 2 500 0000').should be_true
83
- Phony.plausible?('+593 2 700 0000').should be_true
84
- Phony.plausible?('+593 3 000 0000').should be_true
85
- Phony.plausible?('+593 4 000 0000').should be_true
86
- Phony.plausible?('+593 4 500 0000').should be_true
87
- Phony.plausible?('+593 4 600 0000').should be_true
88
- Phony.plausible?('+593 5 200 0000').should be_true
89
- Phony.plausible?('+593 5 300 0000').should be_true
90
- Phony.plausible?('+593 6 200 0000').should be_true
91
- Phony.plausible?('+593 7 200 0000').should be_true
92
- Phony.plausible?('+593 7 300 0000').should be_true
93
- Phony.plausible?('+593 7 400 0000').should be_true
94
- Phony.plausible?('+593 7 600 0000').should be_true
95
- Phony.plausible?('+593 9 0000 0000').should be_true # mobile
72
+ Phony.plausible?('+593 22 000 0000').should be_truthy
73
+ Phony.plausible?('+593 23 000 0000').should be_truthy
74
+ Phony.plausible?('+593 26 000 0000').should be_truthy
75
+ Phony.plausible?('+593 27 000 0000').should be_truthy
76
+ Phony.plausible?('+593 44 000 0000').should be_truthy
77
+ Phony.plausible?('+593 45 000 0000').should be_truthy
78
+ Phony.plausible?('+593 47 000 0000').should be_truthy
79
+ Phony.plausible?('+593 2 200 0000').should be_truthy
80
+ Phony.plausible?('+593 2 300 0000').should be_truthy
81
+ Phony.plausible?('+593 2 400 0000').should be_truthy
82
+ Phony.plausible?('+593 2 500 0000').should be_truthy
83
+ Phony.plausible?('+593 2 700 0000').should be_truthy
84
+ Phony.plausible?('+593 3 000 0000').should be_truthy
85
+ Phony.plausible?('+593 4 000 0000').should be_truthy
86
+ Phony.plausible?('+593 4 500 0000').should be_truthy
87
+ Phony.plausible?('+593 4 600 0000').should be_truthy
88
+ Phony.plausible?('+593 5 200 0000').should be_truthy
89
+ Phony.plausible?('+593 5 300 0000').should be_truthy
90
+ Phony.plausible?('+593 6 200 0000').should be_truthy
91
+ Phony.plausible?('+593 7 200 0000').should be_truthy
92
+ Phony.plausible?('+593 7 300 0000').should be_truthy
93
+ Phony.plausible?('+593 7 400 0000').should be_truthy
94
+ Phony.plausible?('+593 7 600 0000').should be_truthy
95
+ Phony.plausible?('+593 9 0000 0000').should be_truthy # mobile
96
96
  end
97
97
  it_is_correct_for 'Equatorial Guinea', :samples => ['+240 222 201 123',
98
98
  '+240 335 201 123']
@@ -102,21 +102,21 @@ describe 'plausibility' do
102
102
  it_is_correct_for 'Faroe Islands', :samples => '+298 969 597'
103
103
  it_is_correct_for 'Fiji (Republic of)', :samples => '+679 998 2441'
104
104
  it 'is correct for Finland' do
105
- Phony.plausible?('+358 50 123 4').should be_true
106
- Phony.plausible?('+358 50 123 45').should be_true
107
- Phony.plausible?('+358 50 123 45 6').should be_true
108
- Phony.plausible?('+358 50 123 45 67').should be_true
109
- Phony.plausible?('+358 50 123 45 678').should be_true
110
- Phony.plausible?('+358 49 123 456 789').should be_true
111
- Phony.plausible?('+358 18 1234').should be_true
112
- Phony.plausible?('+358 9 1234').should be_true
113
- Phony.plausible?('+358 9 123 45').should be_true
114
- Phony.plausible?('+358 9 123 456').should be_true
115
- Phony.plausible?('+358 9 123 4567').should be_true
116
- Phony.plausible?('+358 20 1470 740').should be_true
117
- Phony.plausible?('+358 29 123 4567').should be_true
118
- Phony.plausible?('+358 75323 1234').should be_true
119
- Phony.plausible?('+358 50 123 456 789').should be_false
105
+ Phony.plausible?('+358 50 123 4').should be_truthy
106
+ Phony.plausible?('+358 50 123 45').should be_truthy
107
+ Phony.plausible?('+358 50 123 45 6').should be_truthy
108
+ Phony.plausible?('+358 50 123 45 67').should be_truthy
109
+ Phony.plausible?('+358 50 123 45 678').should be_truthy
110
+ Phony.plausible?('+358 49 123 456 789').should be_truthy
111
+ Phony.plausible?('+358 18 1234').should be_truthy
112
+ Phony.plausible?('+358 9 1234').should be_truthy
113
+ Phony.plausible?('+358 9 123 45').should be_truthy
114
+ Phony.plausible?('+358 9 123 456').should be_truthy
115
+ Phony.plausible?('+358 9 123 4567').should be_truthy
116
+ Phony.plausible?('+358 20 1470 740').should be_truthy
117
+ Phony.plausible?('+358 29 123 4567').should be_truthy
118
+ Phony.plausible?('+358 75323 1234').should be_truthy
119
+ Phony.plausible?('+358 50 123 456 789').should be_falsey
120
120
  end
121
121
  it_is_correct_for 'French Guiana (French Department of)', :samples => '+594 594 123 456'
122
122
  it_is_correct_for "French Polynesia (Territoire français d'outre-mer)", :samples => '+689 87 27 84 00'
@@ -177,9 +177,9 @@ describe 'plausibility' do
177
177
  '+961 81 123 456']
178
178
  it_is_correct_for 'Lesotho', :samples => '+266 7612 6866'
179
179
  it 'is correct for Liberia' do
180
- Phony.plausible?('+231 2 123 4567').should be_true
181
- Phony.plausible?('+231 4 123 456').should be_true
182
- Phony.plausible?('+231 77 123 4567').should be_true
180
+ Phony.plausible?('+231 2 123 4567').should be_truthy
181
+ Phony.plausible?('+231 4 123 456').should be_truthy
182
+ Phony.plausible?('+231 77 123 4567').should be_truthy
183
183
  end
184
184
  it_is_correct_for 'Macao', :samples => ['+853 28 12 3456',
185
185
  '+853 8 123 4567',
@@ -219,8 +219,8 @@ describe 'plausibility' do
219
219
  '+977 98 1234 5678']
220
220
  it_is_correct_for "New Caledonia (Territoire français d'outre-mer)", :samples => '+687 546 835'
221
221
  it 'is correct for New Zealand' do
222
- Phony.plausible?('+64800123123').should be_true # Free phone
223
- Phony.plausible?('+648001231234').should be_true # Free phone
222
+ Phony.plausible?('+64800123123').should be_truthy # Free phone
223
+ Phony.plausible?('+648001231234').should be_truthy # Free phone
224
224
  end
225
225
  it_is_correct_for 'Nicaragua', :samples => '+505 12 345 678'
226
226
  it_is_correct_for 'Niger', :samples => '+227 1234 5678'
@@ -378,11 +378,11 @@ describe 'plausibility' do
378
378
  '+967 77 123 4567',
379
379
  '+967 58 1234']
380
380
  it 'is correct for Zambia' do
381
- Phony.plausible?('+260 211 123456').should be_true # Fixed
382
- Phony.plausible?('+260 955 123456').should be_true # Mobile
383
- Phony.plausible?('+260 967 123456').should be_true # Mobile
384
- Phony.plausible?('+260 978 123456').should be_true # Mobile
385
- Phony.plausible?('+260 800 123 456').should be_true # Toll free
381
+ Phony.plausible?('+260 211 123456').should be_truthy # Fixed
382
+ Phony.plausible?('+260 955 123456').should be_truthy # Mobile
383
+ Phony.plausible?('+260 967 123456').should be_truthy # Mobile
384
+ Phony.plausible?('+260 978 123456').should be_truthy # Mobile
385
+ Phony.plausible?('+260 800 123 456').should be_truthy # Toll free
386
386
  end
387
387
  it_is_correct_for 'Zimbabwe', :samples => [['+263 2582 123 456', '+263 2582 123'],
388
388
  ['+263 147 123 456', '+263 147 123'],
@@ -390,15 +390,15 @@ describe 'plausibility' do
390
390
  '+263 86 1235 4567']
391
391
 
392
392
  it 'is correct for Indonesia' do
393
- Phony.plausible?('+62 22 000 0').should be_false
394
- Phony.plausible?('+62 22 000 00').should be_true
395
- Phony.plausible?('+62 22 000 0000').should be_true
396
- Phony.plausible?('+62 22 0000 0000').should be_true
397
- Phony.plausible?('+62 22 000 000 000').should be_true
393
+ Phony.plausible?('+62 22 000 0').should be_falsey
394
+ Phony.plausible?('+62 22 000 00').should be_truthy
395
+ Phony.plausible?('+62 22 000 0000').should be_truthy
396
+ Phony.plausible?('+62 22 0000 0000').should be_truthy
397
+ Phony.plausible?('+62 22 000 000 000').should be_truthy
398
398
  end
399
399
 
400
400
  it 'is correct for Russia' do
401
- Phony.plausible?('+7 3522 000 000').should be_true
401
+ Phony.plausible?('+7 3522 000 000').should be_truthy
402
402
  end
403
403
  end
404
404
  end
@@ -356,6 +356,7 @@ describe 'country descriptions' do
356
356
  it_splits '62877123456', %w(62 877 123 456)
357
357
  it_splits '62881123456', %w(62 881 123 456)
358
358
  it_splits '6288112345656', %w(62 881 1234 5656)
359
+ it_splits '62881123456567', %w(62 881 1234 56567)
359
360
  it_splits '628990344805', %w(62 899 034 4805)
360
361
  it_splits '6291234567', %w(62 9 1234 567)
361
362
  it_splits '629123456789', %w(62 9 123 456 789)
@@ -53,35 +53,35 @@ describe Phony::LocalSplitters::Regex do
53
53
  context 'Local splitter without mappings' do
54
54
  let(:local_splitter) { described_class.instance_for({})}
55
55
  it 'returns false' do
56
- result.should be_false
56
+ result.should be_falsey
57
57
  end
58
58
  end
59
59
 
60
60
  context 'Mapping does not exist for a number' do
61
61
  let(:local_splitter) { described_class.instance_for(/\A5/ => [1,2,3])}
62
62
  it 'returns false' do
63
- result.should be_false
63
+ result.should be_falsey
64
64
  end
65
65
  end
66
66
 
67
67
  context "Mapping exists, but the length is greater" do
68
68
  let(:local_splitter) { described_class.instance_for(/\A123/ => [2,2])}
69
69
  it 'returns false' do
70
- result.should be_false
70
+ result.should be_falsey
71
71
  end
72
72
  end
73
73
 
74
74
  context "Mapping exists, but the length is less" do
75
75
  let(:local_splitter) { described_class.instance_for(/\A123/ => [2,2,3])}
76
76
  it 'returns false' do
77
- result.should be_false
77
+ result.should be_falsey
78
78
  end
79
79
  end
80
80
 
81
81
  context 'Mapping exists and the length is equal' do
82
82
  let(:local_splitter) { described_class.instance_for(/\A123/ => [2,2,2])}
83
83
  it 'returns true' do
84
- result.should be_true
84
+ result.should be_truthy
85
85
  end
86
86
  end
87
87
 
@@ -19,7 +19,7 @@ describe Phony::NationalSplitters::Default do
19
19
 
20
20
  describe 'plausible?' do
21
21
  it 'is always plausible' do
22
- splitter.plausible?(:anything, :anything).should be_true
22
+ splitter.plausible?(:anything, :anything).should be_truthy
23
23
  end
24
24
  end
25
25
 
@@ -0,0 +1,74 @@
1
+ require 'spec_helper'
2
+
3
+ describe Phony do
4
+
5
+ describe described_class::NormalizationError do
6
+ it 'is correctly raised on normalize' do
7
+ expect do
8
+ described_class.normalize('000')
9
+ end.to raise_error(described_class::NormalizationError)
10
+ end
11
+ it 'is correctly raised on normalize' do
12
+ expect do
13
+ described_class.normalize('000')
14
+ end.to raise_error(%Q{Phony could not normalize the given number. Is it a phone number?})
15
+ end
16
+ it 'is correctly raised on normalize!' do
17
+ expect do
18
+ described_class.normalize!('000')
19
+ end.to raise_error(described_class::NormalizationError)
20
+ end
21
+ it 'is correctly raised on normalize!' do
22
+ expect do
23
+ described_class.normalize!('000')
24
+ end.to raise_error(%Q{Phony could not normalize the given number. Is it a phone number?})
25
+ end
26
+ end
27
+
28
+ describe described_class::SplittingError do
29
+ it 'is correctly raised on split' do
30
+ expect do
31
+ described_class.split('000')
32
+ end.to raise_error(described_class::SplittingError)
33
+ end
34
+ it 'is correctly raised on split' do
35
+ expect do
36
+ described_class.split('000')
37
+ end.to raise_error(%Q{Phony could not split the given number. Is "000" a phone number?})
38
+ end
39
+ it 'is correctly raised on split!' do
40
+ expect do
41
+ described_class.split!('000')
42
+ end.to raise_error(described_class::SplittingError)
43
+ end
44
+ it 'is correctly raised on split!' do
45
+ expect do
46
+ described_class.split!('000')
47
+ end.to raise_error(%Q{Phony could not split the given number. Is it a phone number?})
48
+ end
49
+ end
50
+
51
+ describe described_class::FormattingError do
52
+ it 'is correctly raised on format' do
53
+ expect do
54
+ described_class.format('000')
55
+ end.to raise_error(described_class::FormattingError)
56
+ end
57
+ it 'is correctly raised on format' do
58
+ expect do
59
+ described_class.format('000')
60
+ end.to raise_error(%Q{Phony could not format the given number. Is it a phone number?})
61
+ end
62
+ it 'is correctly raised on format!' do
63
+ expect do
64
+ described_class.format!('000')
65
+ end.to raise_error(described_class::FormattingError)
66
+ end
67
+ it 'is correctly raised on format!' do
68
+ expect do
69
+ described_class.format!('000')
70
+ end.to raise_error(%Q{Phony could not format the given number. Is it a phone number?})
71
+ end
72
+ end
73
+
74
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.49
4
+ version: 2.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-24 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Fast international phone number (E164 standard) normalizing, splitting
14
14
  and formatting. Lots of formatting options: International (+.., 00..), national
@@ -91,6 +91,7 @@ files:
91
91
  - spec/lib/phony/national_splitters/regex_spec.rb
92
92
  - spec/lib/phony/national_splitters/variable_spec.rb
93
93
  - spec/lib/phony/vanity_spec.rb
94
+ - spec/lib/phony_spec.rb
94
95
  homepage: http://github.com/floere/phony
95
96
  licenses:
96
97
  - MIT
@@ -131,3 +132,4 @@ test_files:
131
132
  - spec/lib/phony/national_splitters/regex_spec.rb
132
133
  - spec/lib/phony/national_splitters/variable_spec.rb
133
134
  - spec/lib/phony/vanity_spec.rb
135
+ - spec/lib/phony_spec.rb