faker 1.6.0 → 1.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16afea76964cc1fb1d8779296e32ed88e450ed42
4
- data.tar.gz: 1470483a239699d09a0cf0c2e8133069f4a82b29
3
+ metadata.gz: 27c952ddf12f507892b74cf2671e181b01af31f9
4
+ data.tar.gz: 8e2708410f8618f004ee8e4e5acac93c0aa26ed4
5
5
  SHA512:
6
- metadata.gz: e5940ec8586f709c265b428d64a11ab0e13ecdd91201a95b2213e4cc04bff2708f5441fba29fabfac9097328e4c3d516a2c2ef87dee41eef315fd662e3005624
7
- data.tar.gz: b4b9b8e736b664fbc4e8974d1dd3dd38d1956763f48d8d21b2426d3fc9ace02547d0ba95fb0587cbce8379051a13d9303593b29363d4a746f254a32757bb73ea
6
+ metadata.gz: 242db2ab7b4a4e05410c49554e8e5bd52f3056bb481a7344ceb77d6a28e1d3f74539b730fc02a3d02ca84d63e3b2f814d8b9509f3d832b4947dfa030adcbfc6a
7
+ data.tar.gz: 2afa80a186b311afdc65f38d58cb84b8415adc4b4d7be1765835e661af54ca94720701be0b91fbf1f1b94775fdba27ab4989cbc87d15d488fd12b162f0882cca
@@ -1,4 +1,7 @@
1
- == 1.6.0 2015-11-20
1
+ == 1.6.1 2015-11-23
2
+ * Fix for locale issues in tests
3
+
4
+ == 1.6.0 2015-11-23
2
5
  * Lots of bug fixes -- most notably, a fix for email addresses and domains in non-en locales
3
6
  * Updated locales: de, en-AU, en-NZ, en-SG, en-US, en-au-ocker, en, es, fr, he, it, ja, nb-NO, pl, pt-BR, sk, and zh-CN
4
7
  * Updated classes: Address, Avatar, Book, Code, Commerce, Company, Hipster, IDNumber, Internet, Number, Placeholdit, Shakespeare, and Time
@@ -1,3 +1,3 @@
1
1
  module Faker #:nodoc:
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
@@ -2,6 +2,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestFakerCity < Test::Unit::TestCase
4
4
  def setup
5
+ @old_locales = I18n.config.available_locales
5
6
  xx = {
6
7
  :faker => {
7
8
  :name => {:first_name => ['alice'], :last_name => ['smith']},
@@ -9,6 +10,7 @@ class TestFakerCity < Test::Unit::TestCase
9
10
  }
10
11
  }
11
12
  I18n.backend.store_translations(:xx, xx)
13
+ I18n.config.available_locales += [ :xx ]
12
14
 
13
15
  xy = {
14
16
  :faker => {
@@ -22,6 +24,11 @@ class TestFakerCity < Test::Unit::TestCase
22
24
  }
23
25
  }
24
26
  I18n.backend.store_translations(:xy, xy)
27
+ I18n.config.available_locales += [ :xy ]
28
+ end
29
+
30
+ def teardown
31
+ I18n.config.available_locales = @old_locales
25
32
  end
26
33
 
27
34
  def test_default_city_formats
@@ -23,6 +23,7 @@ class TestFakerCommerce < Test::Unit::TestCase
23
23
  end
24
24
 
25
25
  def test_department_should_accept_localized_separator
26
+ @old_locales = I18n.config.available_locales
26
27
  data = {
27
28
  :faker => {
28
29
  :separator => ' + ',
@@ -33,9 +34,11 @@ class TestFakerCommerce < Test::Unit::TestCase
33
34
  }
34
35
 
35
36
  I18n.backend.store_translations(:xy, data)
37
+ I18n.config.available_locales += [ :xy ]
36
38
  I18n.with_locale(:xy) do
37
39
  assert_match ' + ', @tester.department(2, true)
38
40
  end
41
+ I18n.config.available_locales = @old_locales
39
42
  end
40
43
 
41
44
  def test_department_should_have_exact_number_of_categories_when_fixed_amount
@@ -2,6 +2,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestFakerStreet < Test::Unit::TestCase
4
4
  def setup
5
+ @old_locales = I18n.config.available_locales
5
6
  shire = {
6
7
  :faker => {
7
8
  :address => {
@@ -17,6 +18,11 @@ class TestFakerStreet < Test::Unit::TestCase
17
18
  }
18
19
  }
19
20
  I18n.backend.store_translations(:shire, shire)
21
+ I18n.config.available_locales += [ :shire ]
22
+ end
23
+
24
+ def teardown
25
+ I18n.config.available_locales = @old_locales
20
26
  end
21
27
 
22
28
  def test_street_name_supports_flexible_formats
@@ -9,10 +9,16 @@ end
9
9
  class TestFlexible < Test::Unit::TestCase
10
10
 
11
11
  def setup
12
+ @old_locales = I18n.config.available_locales
12
13
  I18n.backend.store_translations(:xx, :faker => {:chow => {:yummie => [:fudge, :chocolate, :caramel], :taste => "delicious"}})
13
14
  I18n.backend.store_translations(:home, :faker => {:address => {:birthplace => [:bed, :hospital, :airplane]}})
14
15
  I18n.backend.store_translations(:kindergarden, :faker => {:name => {:girls_name => [:alice, :cheryl, :tatiana]}})
15
16
  I18n.backend.store_translations(:work, :faker => {:company => {:do_stuff => [:work, :work, :work]}})
17
+ I18n.config.available_locales += [ :xx, :home, :kindergarden, :work ]
18
+ end
19
+
20
+ def teardown
21
+ I18n.config.available_locales = @old_locales
16
22
  end
17
23
 
18
24
  def test_flexible_multiple_values
@@ -35,7 +41,7 @@ class TestFlexible < Test::Unit::TestCase
35
41
  end
36
42
  end
37
43
  end
38
-
44
+
39
45
  def test_address_is_flexible
40
46
  I18n.with_locale(:home) do
41
47
  assert [:bed, :hospital, :airplane].include? Faker::Address.birthplace
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Curtis