smartsend-ruby 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6559955d47563838d40e6ed2a3a197c5af19783a5f3b9e8c224941d72a6537f9
4
- data.tar.gz: 99914570cb17b3a22c2fe281e25b17463cecdcc4653600dbb25b5521a20f7999
3
+ metadata.gz: 8358d7bf30fba5941187cd525e9f0febbc3e16b41cb7be2bb74e68d69adeea45
4
+ data.tar.gz: 596d687429e00f057b7a30c82f06911183219299b72ee7867853fefc7d2e91c5
5
5
  SHA512:
6
- metadata.gz: 06e31ba54f3a013a8ea876721a13a89df59d6c624c029f1c9c264f00afac69763a61047acf9da8e1ab93de84ac6c197af3003b3f9778f23e5eb8d49c3a97bebb
7
- data.tar.gz: 9f93847459da401435b5be8d645f2ee891bfcc1a57bd6371fc5bb9e0204cd6c817ede13a36d68bf1b7d3b27e2f66e7beecc8fdf5607631a2536c7f6a6bfd648d
6
+ metadata.gz: d69929fbe04c371f1dc9e94f181bd5d31e80fb094236b8824ec887193009d041d985e797ba2df9f14bd9c3caa521e8d7546ceb0ef1e510003c6ba11b24db1ee5
7
+ data.tar.gz: 40542826b607ace043047cc64090e1cb69bc2447e6b156e0a7cc8062c3ed137c360f711aaa601e15dfffffa4f50a7e8516af67339c5a613793264d34fa9b91f6
data/.gitignore CHANGED
@@ -1,2 +1,5 @@
1
1
  # ignore gem build
2
2
  /*.gem
3
+
4
+ # ignore environment
5
+ .env
@@ -8,7 +8,11 @@ class Smartsend::Account
8
8
  end
9
9
 
10
10
  def valid?
11
- raise NotImplementedError
11
+ begin
12
+ !!Smartsend::Client.new(self).get('user')
13
+ rescue Smartsend::AuthorizationError
14
+ false
15
+ end
12
16
  end
13
17
 
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module Smartsend
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'minitest/autorun'
2
+ require 'smartsend'
3
+
4
+ class AccountTest < Minitest::Test
5
+
6
+ def test_valid_account
7
+ assert !Smartsend::Account.new(api_token: '123').valid?
8
+ assert Smartsend::Account.new(api_token: ENV['SMARTSEND_TOKEN']).valid?
9
+ end
10
+
11
+ end
@@ -6,7 +6,7 @@ class ShipmentTest < Minitest::Test
6
6
 
7
7
  def test_successful_label
8
8
  Smartsend.configure(
9
- api_token: 'test_token',
9
+ api_token: ENV['SMARTSEND_TOKEN'],
10
10
  )
11
11
 
12
12
  shipment = Smartsend::Shipment.new(
@@ -127,7 +127,7 @@ class ShipmentTest < Minitest::Test
127
127
 
128
128
  def test_invalid_request
129
129
  Smartsend.configure(
130
- api_token: 'test_token',
130
+ api_token: ENV['SMARTSEND_TOKEN'],
131
131
  )
132
132
 
133
133
  shipment = Smartsend::Shipment.new(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartsend-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aske Hansen
@@ -51,6 +51,7 @@ files:
51
51
  - lib/smartsend/shipment.rb
52
52
  - lib/smartsend/version.rb
53
53
  - smartsend-ruby.gemspec
54
+ - test/test_account.rb
54
55
  - test/test_shipment.rb
55
56
  - test/test_smartsend.rb
56
57
  homepage: https://github.com/smartsendio/smartsend-ruby
@@ -78,5 +79,6 @@ signing_key:
78
79
  specification_version: 4
79
80
  summary: Smartsend.io api client
80
81
  test_files:
82
+ - test/test_account.rb
81
83
  - test/test_shipment.rb
82
84
  - test/test_smartsend.rb