rakuten_web_service 1.3.0 → 1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36494ec875153de05cd30a11c266d9c2c7d12b09
|
4
|
+
data.tar.gz: dafab6e790770ec344dca796d261a4896c741b54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffddb30af4da3756f6ef0baa4e2ad49c0967d06264eaf39e29c3a1bbb4a109cb7868e63335be9203006f631c4e24ba97144e899532fb2d15a223a7ede2022f2a
|
7
|
+
data.tar.gz: 9464a7badbc80252dfadb8c42104e0deefa028858eb9d09f91ee6545b05bd43cbb27b4ab1071a8e4e0ee08b4d7e28bcb5c1818da190aee180f7281661b240ddd
|
data/CHANGELOG.md
CHANGED
@@ -12,8 +12,13 @@ module RakutenWebService
|
|
12
12
|
convert_snake_key_to_camel_key(default_parameters.merge(params))
|
13
13
|
end
|
14
14
|
|
15
|
-
def default_parameters
|
16
|
-
|
15
|
+
def default_parameters
|
16
|
+
raise "Application ID is not defined" unless has_required_options?
|
17
|
+
{ application_id: application_id, affiliate_id: affiliate_id }
|
18
|
+
end
|
19
|
+
|
20
|
+
def has_required_options?
|
21
|
+
application_id && application_id != ''
|
17
22
|
end
|
18
23
|
|
19
24
|
def debug_mode?
|
@@ -102,4 +102,40 @@ describe RakutenWebService::Configuration do
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
105
|
+
|
106
|
+
describe "#default_parameters" do
|
107
|
+
before do
|
108
|
+
RakutenWebService.configure do |c|
|
109
|
+
c.application_id = application_id
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
context "When application id is given" do
|
114
|
+
let(:application_id) { 'app_id' }
|
115
|
+
|
116
|
+
subject { RakutenWebService.configuration.default_parameters }
|
117
|
+
|
118
|
+
it "has application_id key and its value is a given value" do
|
119
|
+
expect(subject[:application_id]).to eq 'app_id'
|
120
|
+
end
|
121
|
+
end
|
122
|
+
context "When application id is not given" do
|
123
|
+
let(:application_id) { nil }
|
124
|
+
|
125
|
+
it "raises an error" do
|
126
|
+
expect {
|
127
|
+
RakutenWebService.configuration.default_parameters
|
128
|
+
}.to raise_error(RuntimeError, "Application ID is not defined")
|
129
|
+
end
|
130
|
+
end
|
131
|
+
context "When application id is an empty string" do
|
132
|
+
let(:application_id) { '' }
|
133
|
+
|
134
|
+
it "raises an error" do
|
135
|
+
expect {
|
136
|
+
RakutenWebService.configuration.default_parameters
|
137
|
+
}.to raise_error(RuntimeError, "Application ID is not defined")
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
105
141
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rakuten_web_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|