postageapp 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/{LICENSE → LICENSE.md} +1 -1
- data/README.md +1 -1
- data/lib/postageapp/version.rb +1 -1
- data/postageapp.gemspec +1 -1
- data/test/configuration_test.rb +14 -10
- data/test/helper.rb +2 -0
- data/test/live_test.rb +4 -4
- data/test/request_test.rb +3 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eee8e5a9e9b96751117b5069f54aa8ecb833fdf1
|
4
|
+
data.tar.gz: 27f7144b8dddb20b7002e83020397b20c2f0bd26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4595cceffe1fc5f6343757db1aef22fbe8529656bf7f30c5c3c7ed53042228d4174e5d26fd2d88bed85e8f7b63976e272faf0265fbb903183876f4d87e27aac
|
7
|
+
data.tar.gz: a2491f2ca1da5d85d2a75c2ecf321190449ae1d9f2b6d4faca827c940910cbff06b7cc2f46714af205684f4bec11d7c04114eb016044208c7810822536f7db8c
|
data/.travis.yml
CHANGED
data/{LICENSE → LICENSE.md}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2011-
|
1
|
+
Copyright (c) 2011-2016 Scott Tadman, Oleg Khabarov, PostageApp
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
data/lib/postageapp/version.rb
CHANGED
data/postageapp.gemspec
CHANGED
data/test/configuration_test.rb
CHANGED
@@ -3,25 +3,29 @@ require_relative './helper'
|
|
3
3
|
class ConfigurationTest < MiniTest::Test
|
4
4
|
def test_initialization_defaults
|
5
5
|
config = PostageApp::Configuration.new
|
6
|
-
|
6
|
+
|
7
7
|
assert_equal true, config.secure
|
8
|
-
|
8
|
+
|
9
|
+
if (ENV['POSTAGEAPP_API_KEY'])
|
10
|
+
assert_equal ENV['POSTAGEAPP_API_KEY'], config.api_key
|
11
|
+
end
|
12
|
+
|
9
13
|
assert_equal 'https', config.scheme
|
10
14
|
assert_equal ENV['POSTAGEAPP_API_HOST'] || 'api.postageapp.com', config.host
|
11
15
|
assert_equal 443, config.port
|
12
16
|
|
13
|
-
|
17
|
+
assert_nil config.proxy_host
|
14
18
|
assert_equal 1080, config.proxy_port
|
15
|
-
|
16
|
-
|
19
|
+
assert_nil config.proxy_user
|
20
|
+
assert_nil config.proxy_pass
|
17
21
|
|
18
|
-
assert_equal 5,
|
19
|
-
assert_equal 10,
|
20
|
-
|
22
|
+
assert_equal 5, config.http_open_timeout
|
23
|
+
assert_equal 10, config.http_read_timeout
|
24
|
+
assert_nil config.recipient_override
|
21
25
|
assert_equal %w( send_message ), config.requests_to_resend
|
22
|
-
|
26
|
+
assert_nil config.project_root
|
23
27
|
assert_equal 'production', config.environment
|
24
|
-
|
28
|
+
assert_nil config.logger
|
25
29
|
assert_equal 'Ruby', config.framework
|
26
30
|
end
|
27
31
|
|
data/test/helper.rb
CHANGED
data/test/live_test.rb
CHANGED
@@ -4,7 +4,7 @@ class LiveTest < MiniTest::Test
|
|
4
4
|
# Note: Need access to a live PostageApp.com account
|
5
5
|
# See helper.rb to set host / api key
|
6
6
|
|
7
|
-
if (ENV['POSTAGEAPP_API_KEY'])
|
7
|
+
if (ENV['POSTAGEAPP_API_KEY'] and ENV['POSTAGEAPP_API_KEY'] != '__TEST_API_KEY__')
|
8
8
|
def test_configuration
|
9
9
|
config = PostageApp.config
|
10
10
|
|
@@ -19,7 +19,7 @@ class LiveTest < MiniTest::Test
|
|
19
19
|
assert_equal 'PostageApp::Response', response.class.name
|
20
20
|
assert_equal 'ok', response.status
|
21
21
|
assert_match(/^\w{40}$/, response.uid)
|
22
|
-
|
22
|
+
assert_nil response.message
|
23
23
|
assert_equal(
|
24
24
|
{
|
25
25
|
'methods' => %w[
|
@@ -67,7 +67,7 @@ class LiveTest < MiniTest::Test
|
|
67
67
|
assert_equal 'ok', response.status
|
68
68
|
|
69
69
|
assert_match(/^\w{40}$/, response.uid)
|
70
|
-
|
70
|
+
assert_nil response.message
|
71
71
|
assert_match(/\d+/, response.data['message']['id'].to_s)
|
72
72
|
|
73
73
|
receipt = PostageApp::Request.new(
|
@@ -95,7 +95,7 @@ class LiveTest < MiniTest::Test
|
|
95
95
|
|
96
96
|
assert_match(/\A\w{40}$/, response.uid)
|
97
97
|
assert_match(/\ARequest could not be processed/, response.message)
|
98
|
-
|
98
|
+
assert_nil response.data
|
99
99
|
end
|
100
100
|
|
101
101
|
# Testable under ruby 1.9.2 Probably OK in production too... Probably
|
data/test/request_test.rb
CHANGED
@@ -34,6 +34,7 @@ class RequestTest < MiniTest::Test
|
|
34
34
|
|
35
35
|
args = request.arguments_to_send
|
36
36
|
|
37
|
+
assert args['api_key']
|
37
38
|
assert !args['api_key'].empty?
|
38
39
|
assert_match(/^\w{40}$/, args['uid'])
|
39
40
|
|
@@ -122,7 +123,7 @@ class RequestTest < MiniTest::Test
|
|
122
123
|
response = request.send
|
123
124
|
|
124
125
|
assert_equal 'fail', response.status
|
125
|
-
|
126
|
-
|
126
|
+
assert_nil response.uid
|
127
|
+
assert_nil response.data
|
127
128
|
end
|
128
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postageapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Tadman
|
@@ -10,20 +10,20 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.8'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - "
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.8'
|
29
29
|
- !ruby/object:Gem::Dependency
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- ".gitignore"
|
52
52
|
- ".travis.yml"
|
53
53
|
- Gemfile
|
54
|
-
- LICENSE
|
54
|
+
- LICENSE.md
|
55
55
|
- README.md
|
56
56
|
- Rakefile
|
57
57
|
- doc/RAILS2.md
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.5.
|
148
|
+
rubygems_version: 2.5.2
|
149
149
|
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: Client library for PostageApp Email API
|