active_tax 1.1.0 → 1.2.0
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 +4 -4
- data/lib/active_tax/states/wa.rb +2 -0
- data/lib/active_tax/tax.rb +0 -4
- data/lib/active_tax/version.rb +1 -1
- data/test/test_tax.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45c6b407b793f408f799c71b78e78d5ca63bdea0812e40d682e934b9ed712355
|
4
|
+
data.tar.gz: 7701aaf9f1069ae77a1ef86c109abd9c106bd79925d24e02b43dc6c09d8689a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ccf4e36798d7275667c41aa85db17be238bd3310b5cd7ce939601233895ae3986f186380f4d7226a8f2705373b500ce6204a233d13e2a6519ca8de0c77dc281
|
7
|
+
data.tar.gz: 7bf6fd75eab59f80eba0760981b2ab1d547921233e4330b8feeba53105e35cb24eaf1e076bdf25d6579b3296e5fa85cf666ec7a9f430f373317266922e2f3d2d
|
data/lib/active_tax/states/wa.rb
CHANGED
@@ -4,6 +4,8 @@ module ActiveTax
|
|
4
4
|
API_URI = "http://webgis.dor.wa.gov/webapi/AddressRates.aspx/text"
|
5
5
|
|
6
6
|
def self.tax(address={})
|
7
|
+
raise StandardError.new("You must provide a street address to access Washington State sales tax rates. #{address.inspect}") if !address[:address]
|
8
|
+
|
7
9
|
# http://webgis.dor.wa.gov/webapi/AddressRates.aspx/text?output=text&addr=6500+Linderson+Way&city=Tumwater&zip=98501
|
8
10
|
params = {
|
9
11
|
output: "text",
|
data/lib/active_tax/tax.rb
CHANGED
data/lib/active_tax/version.rb
CHANGED
data/test/test_tax.rb
CHANGED
@@ -33,6 +33,18 @@ class TestTax < Minitest::Test
|
|
33
33
|
|
34
34
|
assert_in_delta tax.rate * 100.0, 8.2, 2.5 # 8.2%, within about 2.5%
|
35
35
|
assert_equal tax.location_code, "3406"
|
36
|
-
assert_equal tax.result_code, "
|
36
|
+
assert_equal tax.result_code, "2"
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_missing_info
|
40
|
+
tax = ActiveTax::Tax.new({
|
41
|
+
city: "Seattle",
|
42
|
+
zip: "98102",
|
43
|
+
state: "WA"
|
44
|
+
})
|
45
|
+
|
46
|
+
assert_raises StandardError do
|
47
|
+
tax.result_code
|
48
|
+
end
|
37
49
|
end
|
38
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_tax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|