vizjerai-avalara 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTIyNGQ4OTYzZTE1ZDg0MmZlZDFkNTU5NTY1MWE5NmU4MThkZWM2MA==
4
+ N2Q5YTM1NDg2ODkxNjY5YWFmMjMxOTEzNjJhZTJlOGM4MTQzYjIyNQ==
5
5
  data.tar.gz: !binary |-
6
- NmE4M2RhMTRjZmVmM2NjODhjZTNiZGY0ZDZiNWFhOWVmMDFiY2NkNg==
6
+ NzI0MGRhY2Y1M2FlNzA5NmVhNWRhYzQ5NTc5NzYwYzhiNDRhMjc5Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjE3NjE2Njk1OWFhMGI5NzMxMzY3ZmFiZmI0MTgxYmJiNjc0YWE0MDdmMDE0
10
- ZDBhNjg5ZWQ2ZWY3Zjg0MTg5YzQyZjMwZmUzZmVkNzVhNDhlMDBkZDJhYzJm
11
- OTAyZTQ2NjlhZjkzN2I0YjY0OTljYzM5NmQ1YmY4NDM3NjMyMDk=
9
+ YjBiZjZlNThlYTk4YmZiZTM3NmY5NzU0MjQxMmViYzdjZGNkZTQ1OGJjN2Yx
10
+ NzQ2MTA0MDkxZDUwYWRhNzUxYjRiMWE2ODU1YjE5MzQyMzk5MTA2YjdjMTdj
11
+ N2YzNWQzMmU4ZWJiNGYxMzc4OTQwMDUxZDgwN2QzOTRhNGJhMzA=
12
12
  data.tar.gz: !binary |-
13
- N2UzMGIzOWQzMjIxYjhlN2IxOTNjYmJiNTVmZDQwNjczYjE0ZDIyNTg5ZGYz
14
- ZGEzODI0MzgzY2U0ZjE5MTk5MTljMDA4NTdiMjQ5NWU5NGQxYWRiNzMwNDY0
15
- ZTczZjVkMzk1NzBlNDRlY2Q5NTIyMjlkNmQ1MzNhNDk3NDk0YTE=
13
+ MjBjZmQ0ODE3OTliNmE2ZjA3MTU3NzhlOGYzNDk2ZTEzNzU0Nzc5YTE4NzUw
14
+ Njc5NDlhYzcwNGZlOWJkMmE3NzE1NWJmOGNkNDQwYmRhMTY5NDUyOTdkYjJi
15
+ NDY1NmM0NmIyMGQwMmJiMWFiZDJmOWEyYjkzNzA2ZTAzZWI5ZjM=
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
+ ## 0.2.0 - June 14, 2013
2
+
3
+ - Added test to configuration for better usability. Specifying an endpoint will override this setting.
4
+
1
5
  ## 0.1.0 - June 13, 2013
6
+
2
7
  - Updated tests and gems
3
8
  - Added missing specs for geographical_tax
4
9
  - Added validate address
@@ -7,17 +7,26 @@ class Avalara::Configuration
7
7
  attr_accessor :username
8
8
  attr_writer :version
9
9
 
10
+ # Public: Changes the default endpoint between production and test.
11
+ # Default: nil
12
+ #
13
+ # set to true to change the default to the test endpoint at 'https://development.avalara.net'
14
+ # set to false or leave default to use the production endpoint at 'https://rest.avalara.net'
15
+ #
16
+ # Returns nil or the value of test
17
+ #
18
+ attr_accessor :test
19
+
10
20
  ##
11
- # Public: Get the API endpoint used by the configuration. Unless explicitly
12
- # set, the endpoint will default to the official production endpoint at
13
- # 'https://rest.avalara.net'.
21
+ # Public: Get the API endpoint used by the configuration.
14
22
  #
15
- # If you want to set this to the test endpoint, use 'https://development.avalara.net'
23
+ # If the default endpoints are not needed the endpoint can be overridden with another one.
16
24
  #
17
25
  # Returns the String for the API endpoint.
18
26
  #
19
27
  def endpoint
20
- @endpoint ||= 'https://rest.avalara.net'
28
+ return @endpoint if @endpoint
29
+ test ? 'https://development.avalara.net' : 'https://rest.avalara.net'
21
30
  end
22
31
 
23
32
  ##
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Avalara
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  username: 'testaccount'
2
2
  password: 'testkey'
3
- endpoint: 'https://development.avalara.net'
3
+ test: true
@@ -7,7 +7,7 @@ describe Avalara::Configuration do
7
7
 
8
8
  context '#endpoint' do
9
9
  it 'defaults to https://rest.avalara.net' do
10
- configuration.endpoint.should == 'https://rest.avalara.net'
10
+ expect(configuration.endpoint).to eq 'https://rest.avalara.net'
11
11
  end
12
12
 
13
13
  it 'may be overridden' do
@@ -15,8 +15,38 @@ describe Avalara::Configuration do
15
15
  configuration.endpoint = 'https://example.local/'
16
16
  }.to change(configuration, :endpoint).to('https://example.local/')
17
17
  end
18
+
19
+ context 'with test == true' do
20
+ it 'defaults to https://development.avalara.net' do
21
+ expect {
22
+ configuration.test = true
23
+ }.to change(configuration, :endpoint).to 'https://development.avalara.net'
24
+ end
25
+
26
+ it 'can be overridden' do
27
+ expect {
28
+ configuration.test = true
29
+ configuration.endpoint = 'https://example.local/'
30
+ }.to change(configuration, :endpoint).to('https://example.local/')
31
+ end
32
+ end
33
+
34
+ context 'with test == false' do
35
+ it 'defaults to https://rest.avalara.net' do
36
+ expect {
37
+ configuration.test = false
38
+ }.to_not change(configuration, :endpoint)
39
+ end
40
+
41
+ it 'can be overridden' do
42
+ expect {
43
+ configuration.test = false
44
+ configuration.endpoint = 'https://example.local/'
45
+ }.to change(configuration, :endpoint).to('https://example.local/')
46
+ end
47
+ end
18
48
  end
19
-
49
+
20
50
  context '#version' do
21
51
  it 'defaults to 1.0' do
22
52
  configuration.version.should == '1.0'
@@ -52,4 +82,4 @@ describe Avalara::Configuration do
52
82
  }.to change(configuration, :password).to('abcdefg')
53
83
  end
54
84
  end
55
- end
85
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vizjerai-avalara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Fortuna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-13 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie