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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c39904da2bd27e394e5b441bb8a94b6dc677c988566c4c9920a313c6e71616f4
4
- data.tar.gz: 924a836078bc0f86bf0d4b5f08aa4ccb4d1e35391f944213a8a77df94b24d1aa
3
+ metadata.gz: 45c6b407b793f408f799c71b78e78d5ca63bdea0812e40d682e934b9ed712355
4
+ data.tar.gz: 7701aaf9f1069ae77a1ef86c109abd9c106bd79925d24e02b43dc6c09d8689a7
5
5
  SHA512:
6
- metadata.gz: caff39a4389911bb873d2a27a7ce0e4b66eed50a45a1ce2a69017c7dcefe0ac70f4859c072a0cd34f52fff0c908c421ed05fd29235247b42a5dd891b6ae893b4
7
- data.tar.gz: '02835830e47258fa57c6331faeedff935214e0126644d66328891f692c6882175f8a22c1846752ce9266d27829741761f857abd3ec80afcb59953f866da8c403'
6
+ metadata.gz: 1ccf4e36798d7275667c41aa85db17be238bd3310b5cd7ce939601233895ae3986f186380f4d7226a8f2705373b500ce6204a233d13e2a6519ca8de0c77dc281
7
+ data.tar.gz: 7bf6fd75eab59f80eba0760981b2ab1d547921233e4330b8feeba53105e35cb24eaf1e076bdf25d6579b3296e5fa85cf666ec7a9f430f373317266922e2f3d2d
@@ -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",
@@ -42,9 +42,5 @@ module ActiveTax
42
42
  else raise StandardError, "API for #{self.state.upcase} not yet implemented in ActiveTax."
43
43
  end
44
44
  end
45
-
46
- def api_data
47
-
48
- end
49
45
  end
50
46
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveTax
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -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, "0"
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.1.0
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: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake