sevenwire-forgery 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 2
3
- :patch: 1
3
+ :patch: 2
4
4
  :major: 0
@@ -0,0 +1,13 @@
1
+ ON
2
+ QC
3
+ NS
4
+ NB
5
+ MB
6
+ BC
7
+ PE
8
+ SK
9
+ AB
10
+ NL
11
+ NT
12
+ YT
13
+ NU
@@ -0,0 +1,13 @@
1
+ Ontario
2
+ Quebec
3
+ Nova Scotia
4
+ New Brunswick
5
+ Manitoba
6
+ British Columbia
7
+ Prince Edward Island
8
+ Saskatchewan
9
+ Alberta
10
+ Newfoundland and Labrador
11
+ Northwest Territories
12
+ Yukon
13
+ Nunavut
@@ -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.1
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: 2008-11-30 00:00:00 -08:00
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: false
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