commission_junction 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/README.md +2 -0
- data/commission_junction.gemspec +2 -1
- data/lib/commission_junction/version.rb +1 -1
- data/test/commission_junction_test.rb +26 -22
- data/test/test_helper.rb +1 -1
- metadata +23 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7ab943bace77b485e6110b8d695e0acdec7eaa0a
|
4
|
+
data.tar.gz: 84fa57ee60a4261f72d56e5c8b3d99fe0bf4853c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce1048ba1ec05ad25418fb26904e87bea333bb833c4c37899cea406d6ded3a1c3341470a248f41cd17a08446562bd3bfb4202633da33708744f705b037f2fa84
|
7
|
+
data.tar.gz: 474a159184e3662e43d38e0da325ad8c1f91518a6d308a83b527cfe9acb0a2866bba3b1c0db106ea7f7906ea14abb6efcfa1e0ca7b6e2deaa442cb839f50185f
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/commission_junction.gemspec
CHANGED
@@ -16,5 +16,6 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ['lib']
|
19
|
-
gem.add_dependency 'httparty', '~> 0.
|
19
|
+
gem.add_dependency 'httparty', '~> 0.12'
|
20
|
+
gem.add_dependency 'minitest'
|
20
21
|
end
|
@@ -1,44 +1,48 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class CommissionJunctionTest < Test
|
3
|
+
class CommissionJunctionTest < Minitest::Test
|
4
|
+
def assert_nothing_raised(*)
|
5
|
+
yield
|
6
|
+
end
|
7
|
+
|
4
8
|
def test_new_cj_with_no_params
|
5
|
-
|
9
|
+
assert_raises ArgumentError do
|
6
10
|
CommissionJunction.new
|
7
11
|
end
|
8
12
|
end
|
9
13
|
|
10
14
|
def test_new_cj_with_one_param
|
11
|
-
|
15
|
+
assert_raises ArgumentError do
|
12
16
|
CommissionJunction.new('fake')
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
16
20
|
def test_new_cj_with_nil_param
|
17
|
-
|
21
|
+
assert_raises ArgumentError do
|
18
22
|
CommissionJunction.new(nil, 'website_id')
|
19
23
|
end
|
20
24
|
|
21
|
-
|
25
|
+
assert_raises ArgumentError do
|
22
26
|
CommissionJunction.new('developer_key', nil)
|
23
27
|
end
|
24
28
|
|
25
|
-
|
29
|
+
assert_raises ArgumentError do
|
26
30
|
CommissionJunction.new('developer_key', 'website_id', nil)
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def test_new_cj_with_empty_param
|
31
|
-
|
35
|
+
assert_raises ArgumentError do
|
32
36
|
CommissionJunction.new('', 'website_id')
|
33
37
|
end
|
34
38
|
|
35
|
-
|
39
|
+
assert_raises ArgumentError do
|
36
40
|
CommissionJunction.new('developer_key', '')
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
40
44
|
def test_new_cj_with_non_string_param
|
41
|
-
|
45
|
+
assert_raises ArgumentError do
|
42
46
|
CommissionJunction.new(123456, 'website_id')
|
43
47
|
end
|
44
48
|
|
@@ -48,17 +52,17 @@ class CommissionJunctionTest < Test::Unit::TestCase
|
|
48
52
|
end
|
49
53
|
|
50
54
|
def test_new_cj_with_non_fixnum_timeout
|
51
|
-
|
55
|
+
assert_raises ArgumentError do
|
52
56
|
CommissionJunction.new('developer_key', 'website_id', '10')
|
53
57
|
end
|
54
58
|
end
|
55
59
|
|
56
60
|
def test_new_cj_with_non_positive_timeout
|
57
|
-
|
61
|
+
assert_raises ArgumentError do
|
58
62
|
CommissionJunction.new('developer_key', 'website_id', 0)
|
59
63
|
end
|
60
64
|
|
61
|
-
|
65
|
+
assert_raises ArgumentError do
|
62
66
|
CommissionJunction.new('developer_key', 'website_id', -1)
|
63
67
|
end
|
64
68
|
end
|
@@ -74,31 +78,31 @@ class CommissionJunctionTest < Test::Unit::TestCase
|
|
74
78
|
end
|
75
79
|
|
76
80
|
def test_new_product_with_no_params
|
77
|
-
|
81
|
+
assert_raises ArgumentError do
|
78
82
|
CommissionJunction::Product.new
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
82
86
|
def test_new_product_with_nil_params
|
83
|
-
|
87
|
+
assert_raises ArgumentError do
|
84
88
|
CommissionJunction::Product.new(nil)
|
85
89
|
end
|
86
90
|
end
|
87
91
|
|
88
92
|
def test_new_product_with_empty_params
|
89
|
-
|
93
|
+
assert_raises ArgumentError do
|
90
94
|
CommissionJunction::Product.new({})
|
91
95
|
end
|
92
96
|
end
|
93
97
|
|
94
98
|
def test_new_product_with_non_hash_params
|
95
|
-
|
99
|
+
assert_raises ArgumentError do
|
96
100
|
CommissionJunction::Product.new([1, 2, 3])
|
97
101
|
end
|
98
102
|
end
|
99
103
|
|
100
104
|
def test_new_product_with_hash_params_and_non_string_keys
|
101
|
-
|
105
|
+
assert_raises ArgumentError do
|
102
106
|
CommissionJunction::Product.new(:name => 'blue jeans', :price => '49.95')
|
103
107
|
end
|
104
108
|
end
|
@@ -115,25 +119,25 @@ class CommissionJunctionTest < Test::Unit::TestCase
|
|
115
119
|
end
|
116
120
|
|
117
121
|
def test_product_search_with_no_params
|
118
|
-
|
122
|
+
assert_raises ArgumentError do
|
119
123
|
CommissionJunction.new('developer_key', 'website_id').product_search
|
120
124
|
end
|
121
125
|
end
|
122
126
|
|
123
127
|
def test_product_search_with_nil_params
|
124
|
-
|
128
|
+
assert_raises ArgumentError do
|
125
129
|
CommissionJunction.new('developer_key', 'website_id').product_search(nil)
|
126
130
|
end
|
127
131
|
end
|
128
132
|
|
129
133
|
def test_product_search_with_empty_params
|
130
|
-
|
134
|
+
assert_raises ArgumentError do
|
131
135
|
CommissionJunction.new('developer_key', 'website_id').product_search({})
|
132
136
|
end
|
133
137
|
end
|
134
138
|
|
135
139
|
def test_product_search_with_non_hash_params
|
136
|
-
|
140
|
+
assert_raises ArgumentError do
|
137
141
|
CommissionJunction.new('developer_key', 'website_id').product_search([1, 2, 3])
|
138
142
|
end
|
139
143
|
end
|
@@ -141,7 +145,7 @@ class CommissionJunctionTest < Test::Unit::TestCase
|
|
141
145
|
def test_product_search_with_bad_key
|
142
146
|
cj = CommissionJunction.new('bad_key', 'website_id')
|
143
147
|
|
144
|
-
|
148
|
+
assert_raises ArgumentError do
|
145
149
|
cj.product_search('keywords' => '+some +product')
|
146
150
|
end
|
147
151
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,32 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commission_junction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.6.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Albert Vernon
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-02-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: httparty
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
19
|
+
version: '0.12'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
26
|
+
version: '0.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
30
41
|
description: Ruby wrapper for the Commission Junction web services APIs (REST)
|
31
42
|
email: aev@vernon.nu
|
32
43
|
executables: []
|
@@ -45,27 +56,26 @@ files:
|
|
45
56
|
- test/test_helper.rb
|
46
57
|
homepage: https://github.com/aevernon/commission_junction
|
47
58
|
licenses: []
|
59
|
+
metadata: {}
|
48
60
|
post_install_message:
|
49
61
|
rdoc_options: []
|
50
62
|
require_paths:
|
51
63
|
- lib
|
52
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
65
|
requirements:
|
55
|
-
- -
|
66
|
+
- - '>='
|
56
67
|
- !ruby/object:Gem::Version
|
57
68
|
version: '0'
|
58
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
70
|
requirements:
|
61
|
-
- -
|
71
|
+
- - '>='
|
62
72
|
- !ruby/object:Gem::Version
|
63
73
|
version: '0'
|
64
74
|
requirements: []
|
65
75
|
rubyforge_project:
|
66
|
-
rubygems_version:
|
76
|
+
rubygems_version: 2.0.5
|
67
77
|
signing_key:
|
68
|
-
specification_version:
|
78
|
+
specification_version: 4
|
69
79
|
summary: Commission Junction web services APIs (REST)
|
70
80
|
test_files:
|
71
81
|
- test/commission_junction_test.rb
|