valvat 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ### dev
2
2
 
3
- [full changelog](http://github.com/yolk/valvat/compare/v0.3.2...master)
3
+ [full changelog](http://github.com/yolk/valvat/compare/v0.3.3...master)
4
+
5
+ ### 0.3.3 / 2011-06-02
6
+
7
+ [full changelog](http://github.com/yolk/valvat/compare/v0.3,2...v0.3.3)
8
+
9
+ * Add Valvat::Utils.iso_country_to_vat_country (by [Deb Bassett](https://github.com/urbanwide))
4
10
 
5
11
  ### 0.3.2 / 2011-01-14
6
12
 
data/lib/valvat/utils.rb CHANGED
@@ -19,5 +19,9 @@ class Valvat
19
19
  def self.vat_country_to_iso_country(vat_country)
20
20
  vat_country == "EL" ? "GR" : vat_country
21
21
  end
22
+
23
+ def self.iso_country_to_vat_country(iso_country)
24
+ iso_country == "GR" ? "EL" : iso_country
25
+ end
22
26
  end
23
27
  end
@@ -1,3 +1,3 @@
1
1
  class Valvat
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -63,4 +63,16 @@ describe Valvat::Utils do
63
63
  end
64
64
  end
65
65
  end
66
+
67
+ context "#iso_country_to_vat_country" do
68
+ it "returns vat country on greek iso country code 'GR'" do
69
+ Valvat::Utils.iso_country_to_vat_country("GR").should eql("EL")
70
+ end
71
+
72
+ Valvat::Utils::EU_COUNTRIES.reject{|c| c == "GR"}.each do |c|
73
+ it "returns unchanged vat country code '#{c}'" do
74
+ Valvat::Utils.iso_country_to_vat_country(c).should eql(c)
75
+ end
76
+ end
77
+ end
66
78
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 2
9
- version: 0.3.2
8
+ - 3
9
+ version: 0.3.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sebastian Munz
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-14 00:00:00 +01:00
17
+ date: 2011-06-02 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency