air18n 0.1.56 → 0.1.57

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.
@@ -60,7 +60,7 @@ module Air18n
60
60
  # Returns whether or not imperial lengths are appropriate under
61
61
  # I18n.full_locale and I18n.tld_country.
62
62
  def uses_imperial_lengths?
63
- uses_imperial_lengths_in_locale_and_country(I18n.full_locale, I18n.tld_country)
63
+ uses_imperial_lengths_in_locale_and_country?(I18n.full_locale, I18n.tld_country)
64
64
  end
65
65
 
66
66
  # Returns whether or not imperial lengths are appropriate for given locale
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.56"
2
+ VERSION = "0.1.57"
3
3
  end
@@ -45,10 +45,27 @@ describe Air18n do
45
45
  end
46
46
 
47
47
  context 'uses_imperial_lengths?' do
48
- I18n.uses_imperial_lengths_in_locale_and_country?(:en, :US).should == true
49
- I18n.uses_imperial_lengths_in_locale_and_country?(:en, :GB).should == true
50
- I18n.uses_imperial_lengths_in_locale_and_country?(:en, :AU).should == false
51
- I18n.uses_imperial_lengths_in_locale_and_country?(:fr, :US).should == false
48
+ it 'should work with given locale and country' do
49
+ I18n.uses_imperial_lengths_in_locale_and_country?(:en, :US).should == true
50
+ I18n.uses_imperial_lengths_in_locale_and_country?(:en, :GB).should == true
51
+ I18n.uses_imperial_lengths_in_locale_and_country?(:"en-GB", :GB).should == true
52
+ I18n.uses_imperial_lengths_in_locale_and_country?(:en, :AU).should == false
53
+ I18n.uses_imperial_lengths_in_locale_and_country?(:fr, :US).should == false
54
+ end
55
+
56
+ it 'should work using I18n.tld_country and I18n.full_locale' do
57
+ I18n.run_in_locale(:en) do
58
+ old_country = I18n.tld_country
59
+ I18n.tld_country = :US
60
+ I18n.uses_imperial_lengths?.should == true
61
+ I18n.tld_country = :BE
62
+ I18n.uses_imperial_lengths?.should == false
63
+ I18n.tld_country = old_country
64
+ end
65
+ I18n.run_in_locale(:fr) do
66
+ I18n.uses_imperial_lengths?.should == false
67
+ end
68
+ end
52
69
  end
53
70
 
54
71
  context 'Keeping track of default routes context' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.56
4
+ version: 0.1.57
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-01-28 00:00:00.000000000 Z
16
+ date: 2013-01-29 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n