phony 2.19.11 → 2.20.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,34 +4,30 @@ describe Phony::NationalSplitters::Variable do
4
4
 
5
5
  describe 'split' do
6
6
  context 'normal' do
7
- before(:each) do
8
- @splitter = Phony::NationalSplitters::Variable.new 4, ['1', '316', '67', '68', '669', '711']
9
- end
7
+ let(:splitter) { Phony::NationalSplitters::Variable.new 4, ['1', '316', '67', '68', '669', '711'] }
10
8
  it "handles Vienna" do
11
- @splitter.split('198110').should == [nil, '1', '98110']
9
+ expect(splitter.split('198110')).to eq [nil, '1', '98110']
12
10
  end
13
11
  it "handles some mobile services" do
14
- @splitter.split('66914093902').should == [nil, '669', '14093902']
12
+ expect(splitter.split('66914093902')).to eq [nil, '669', '14093902']
15
13
  end
16
14
  it "handles Graz" do
17
- @splitter.split('3161234567891').should == [nil, '316', '1234567891']
15
+ expect(splitter.split('3161234567891')).to eq [nil, '316', '1234567891']
18
16
  end
19
17
  it "handles Rohrau" do
20
- @splitter.split('2164123456789').should == [nil, '2164', '123456789']
18
+ expect(splitter.split('2164123456789')).to eq [nil, '2164', '123456789']
21
19
  end
22
20
  it 'has an NDC length of 3' do
23
- @splitter.length.should == (1..3)
21
+ expect(splitter.length).to eq (1..3)
24
22
  end
25
23
  end
26
24
  context 'special handling for using the variable size splitter for Swiss service numbers' do
27
- before(:each) do
28
- @splitter = Phony::NationalSplitters::Variable.new 2, ['800']
29
- end
25
+ let(:splitter) { Phony::NationalSplitters::Variable.new 2, ['800'] }
30
26
  it "should handle swiss service numbers" do
31
- @splitter.split('800223344').should == [nil, '800', '223344']
27
+ expect(splitter.split('800223344')).to eq [nil, '800', '223344']
32
28
  end
33
29
  it 'has an NDC length of 3' do
34
- @splitter.length.should == (3..3)
30
+ expect(splitter.length).to eq (3..3)
35
31
  end
36
32
  end
37
33
  end
@@ -8,22 +8,22 @@ describe Phony::Vanity do
8
8
 
9
9
  describe '.replace' do
10
10
  it 'replaces letters with digits' do
11
- vanity.replace('1-800-HELLO').should == '1-800-43556'
11
+ expect(vanity.replace('1-800-HELLO')).to eq '1-800-43556'
12
12
  end
13
13
  end
14
14
 
15
15
  describe '.vanity?' do
16
16
  it 'returns true on a vanity number' do
17
- vanity.vanity?('800HELLOES').should == true
17
+ expect(vanity.vanity?('800HELLOES')).to eq true
18
18
  end
19
19
  it 'returns false on a non-vanity number' do
20
- vanity.vanity?('8004355637').should == false
20
+ expect(vanity.vanity?('8004355637')).to eq false
21
21
  end
22
22
  end
23
23
 
24
24
  describe '.normalized' do
25
25
  it 'normalizes the vanity number' do
26
- vanity.normalized('1-800-HELLO').should == '1800HELLO'
26
+ expect(vanity.normalized('1-800-HELLO')).to eq '1800HELLO'
27
27
  end
28
28
  end
29
29
 
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.19.11
4
+ version: 2.20.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-21 00:00:00.000000000 Z
11
+ date: 2024-08-13 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
@@ -115,26 +115,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.1.6
118
+ rubygems_version: 3.4.19
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Fast international phone number (E164 standard) normalizing, splitting and
122
122
  formatting.
123
123
  test_files:
124
- - spec/lib/phony_spec.rb
125
- - spec/lib/phony/trunk_code_spec.rb
126
- - spec/lib/phony/country_spec.rb
127
- - spec/lib/phony/national_code_spec.rb
124
+ - spec/functional/config_spec.rb
125
+ - spec/functional/plausibility_spec.rb
128
126
  - spec/lib/phony/countries_spec.rb
127
+ - spec/lib/phony/country_codes_spec.rb
128
+ - spec/lib/phony/country_spec.rb
129
129
  - spec/lib/phony/dsl_spec.rb
130
- - spec/lib/phony/national_splitters/variable_spec.rb
130
+ - spec/lib/phony/local_splitters/fixed_spec.rb
131
+ - spec/lib/phony/local_splitters/regex_spec.rb
132
+ - spec/lib/phony/national_code_spec.rb
133
+ - spec/lib/phony/national_splitters/default_spec.rb
134
+ - spec/lib/phony/national_splitters/fixed_spec.rb
131
135
  - spec/lib/phony/national_splitters/none_spec.rb
132
136
  - spec/lib/phony/national_splitters/regex_spec.rb
133
- - spec/lib/phony/national_splitters/fixed_spec.rb
134
- - spec/lib/phony/national_splitters/default_spec.rb
135
- - spec/lib/phony/country_codes_spec.rb
136
- - spec/lib/phony/local_splitters/regex_spec.rb
137
- - spec/lib/phony/local_splitters/fixed_spec.rb
137
+ - spec/lib/phony/national_splitters/variable_spec.rb
138
+ - spec/lib/phony/trunk_code_spec.rb
138
139
  - spec/lib/phony/vanity_spec.rb
139
- - spec/functional/config_spec.rb
140
- - spec/functional/plausibility_spec.rb
140
+ - spec/lib/phony_spec.rb