chiketto 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chiketto/address.rb +2 -1
- data/lib/chiketto/version.rb +1 -1
- data/test/address_test.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b70dd062de74bb8aeaaa5e3eeb047e900ae138d
|
4
|
+
data.tar.gz: 7d06835feb2cb0869f896cc4a14e3f51a766aaa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5389b9e437c0c44ccf7f2643dd01e90919c0408c16eaceef33ce9736f9bd9fa8b1fd57a9342a255b51c0f2731943dd70f40049e9a1f2f662e62ebdb66a158077
|
7
|
+
data.tar.gz: 6019d8aa094986af4ee88f571352e348ae957ed9bacb4d01a764582bde50ea2b0f60f1b4049d8578d5cbe962b4abfcd8ec32305a8adac1b3f019e45b8d9e30cc
|
data/lib/chiketto/address.rb
CHANGED
@@ -5,12 +5,13 @@ module Chiketto
|
|
5
5
|
:region,
|
6
6
|
:address_1,
|
7
7
|
:address_2,
|
8
|
+
:postal_code,
|
8
9
|
:country_name,
|
9
10
|
:longitude,
|
10
11
|
:latitude
|
11
12
|
|
12
13
|
def to_s
|
13
|
-
[@address_1, @address_2, @city, @region, @country].
|
14
|
+
[@address_1, @address_2, @city, @region, @postal_code, @country].
|
14
15
|
reject { |p| p.nil? }.join(', ')
|
15
16
|
end
|
16
17
|
end
|
data/lib/chiketto/version.rb
CHANGED
data/test/address_test.rb
CHANGED
@@ -7,6 +7,7 @@ class AddressTest < MiniTest::Test
|
|
7
7
|
'region' => 'CA',
|
8
8
|
'address_1' => '651 Brannan',
|
9
9
|
'address_2' => 'Suite 110',
|
10
|
+
'postal_code' => '12345',
|
10
11
|
'country_name' => 'United States',
|
11
12
|
'latitude' => '42.3618641',
|
12
13
|
'longitude' => '-71.0905626'
|
@@ -18,17 +19,18 @@ class AddressTest < MiniTest::Test
|
|
18
19
|
assert_respond_to @address, :region
|
19
20
|
assert_respond_to @address, :address_1
|
20
21
|
assert_respond_to @address, :address_2
|
22
|
+
assert_respond_to @address, :postal_code
|
21
23
|
assert_respond_to @address, :country_name
|
22
24
|
assert_respond_to @address, :longitude
|
23
25
|
assert_respond_to @address, :latitude
|
24
26
|
end
|
25
27
|
|
26
28
|
def test_responds_to_string_method
|
27
|
-
assert_equal '651 Brannan, Suite 110, San Francisco, CA, US', @address.to_s
|
29
|
+
assert_equal '651 Brannan, Suite 110, San Francisco, CA, 12345, US', @address.to_s
|
28
30
|
end
|
29
31
|
|
30
32
|
def test_does_not_include_blanks_in_string
|
31
33
|
@address.region = nil
|
32
|
-
assert_equal '651 Brannan, Suite 110, San Francisco, US', @address.to_s
|
34
|
+
assert_equal '651 Brannan, Suite 110, San Francisco, 12345, US', @address.to_s
|
33
35
|
end
|
34
36
|
end
|