divISOr 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/divISOr.gemspec +1 -1
- data/lib/divISOr/iso.rb +1 -1
- data/spec/divISOr/iso3166_spec.rb +14 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/divISOr.gemspec
CHANGED
data/lib/divISOr/iso.rb
CHANGED
@@ -25,10 +25,23 @@ end
|
|
25
25
|
describe ISO3166::Codes do
|
26
26
|
context 'validation' do
|
27
27
|
let(:iso_3166) {ISO3166::Codes.new}
|
28
|
-
let(:iso_records) { mock(:values_for => ['US']) }
|
28
|
+
let(:iso_records) { mock(:values_for => ['US', '123']) }
|
29
29
|
before { ISORecords.stub(:new => iso_records) }
|
30
30
|
|
31
31
|
context 'on default field' do
|
32
|
+
it 'returns false for a nil value' do
|
33
|
+
iso_3166.validate(nil).should be_false
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'does not match nil to ""' do
|
37
|
+
iso_records.stub(:values_for => [''])
|
38
|
+
iso_3166.validate(nil).should be_false
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'validates a number' do
|
42
|
+
iso_3166.validate(123).should be_true
|
43
|
+
end
|
44
|
+
|
32
45
|
it 'gets a list of values' do
|
33
46
|
iso_records.should_receive(:values_for).with(:code)
|
34
47
|
iso_3166.validate('US')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: divISOr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "David Henry and Alberto Pe\xC3\xB1a"
|