sevenwire-forgery 0.2.1 → 0.2.2
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.yml +1 -1
- data/lib/dictionaries/province_abbrevs +13 -0
- data/lib/dictionaries/provinces +13 -0
- data/lib/forgeries/address_forgery.rb +22 -0
- data/spec/forgeries/address_forgery_spec.rb +10 -0
- metadata +8 -5
data/VERSION.yml
CHANGED
@@ -79,6 +79,28 @@ class AddressForgery < Forgery
|
|
79
79
|
dictionaries[:state_abbrevs].random
|
80
80
|
end
|
81
81
|
|
82
|
+
# Gets a random Canadian province or territory out of the 'provinces' dictionary.
|
83
|
+
#
|
84
|
+
# AddressForgery.province
|
85
|
+
# # => "Ontario"
|
86
|
+
#
|
87
|
+
# AddressForgery.province
|
88
|
+
# # => "Northwest Territories"
|
89
|
+
def self.province
|
90
|
+
dictionaries[:provinces].random
|
91
|
+
end
|
92
|
+
|
93
|
+
# Gets a random Canadian province or territory abbreviation out of the 'province_abbrev' dictionary.
|
94
|
+
#
|
95
|
+
# AddressForgery.province_abbrev
|
96
|
+
# # => "ON"
|
97
|
+
#
|
98
|
+
# AddressForgery.province_abbrev
|
99
|
+
# # => "NT"
|
100
|
+
def self.province_abbrev
|
101
|
+
dictionaries[:province_abbrevs].random
|
102
|
+
end
|
103
|
+
|
82
104
|
# Gets one of the formats from 'zip_formats' and converts it to numbers.
|
83
105
|
#
|
84
106
|
# AddressForgery.zip
|
@@ -52,6 +52,16 @@ describe AddressForgery do
|
|
52
52
|
Forgery.dictionaries[:state_abbrevs].should include(state_abbrev)
|
53
53
|
end
|
54
54
|
|
55
|
+
it "should return a random Canadian province or territory" do
|
56
|
+
province = AddressForgery.province
|
57
|
+
Forgery.dictionaries[:provinces].should include(province)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should return a random Canadian province or territory abbreviation" do
|
61
|
+
province_abbrev = AddressForgery.province_abbrev
|
62
|
+
Forgery.dictionaries[:province_abbrevs].should include(province_abbrev)
|
63
|
+
end
|
64
|
+
|
55
65
|
it "should return a random country" do
|
56
66
|
country = AddressForgery.country
|
57
67
|
Forgery.dictionaries[:countries].should include(country)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sevenwire-forgery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Sutton
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-07 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -41,6 +41,8 @@ files:
|
|
41
41
|
- lib/dictionaries/male_first_names
|
42
42
|
- lib/dictionaries/name_suffixes
|
43
43
|
- lib/dictionaries/name_titles
|
44
|
+
- lib/dictionaries/province_abbrevs
|
45
|
+
- lib/dictionaries/provinces
|
44
46
|
- lib/dictionaries/races
|
45
47
|
- lib/dictionaries/shirt_sizes
|
46
48
|
- lib/dictionaries/state_abbrevs
|
@@ -86,11 +88,12 @@ files:
|
|
86
88
|
- spec/forgery_spec.rb
|
87
89
|
- spec/formats_spec.rb
|
88
90
|
- spec/spec_helper.rb
|
89
|
-
has_rdoc:
|
91
|
+
has_rdoc: true
|
90
92
|
homepage: http://github.com/sevenwire/forgery
|
91
93
|
post_install_message:
|
92
|
-
rdoc_options:
|
93
|
-
|
94
|
+
rdoc_options:
|
95
|
+
- --inline-source
|
96
|
+
- --charset=UTF-8
|
94
97
|
require_paths:
|
95
98
|
- lib
|
96
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|