click_and_send 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/click_and_send/request.rb +6 -3
- data/lib/click_and_send/version.rb +1 -1
- data/spec/click_and_send/request_spec.rb +15 -11
- metadata +4 -4
@@ -101,12 +101,15 @@ module ClickAndSend
|
|
101
101
|
rescue StandardError => e
|
102
102
|
message = <<-EOS.strip.gsub(/\n +/, "\n")
|
103
103
|
#{e.class} #{e.message}
|
104
|
-
|
104
|
+
--
|
105
|
+
extra_request_xml:
|
106
|
+
#{extra_request_xml}
|
107
|
+
--
|
105
108
|
raw response:
|
106
109
|
#{raw}
|
107
|
-
|
110
|
+
--
|
108
111
|
result:
|
109
|
-
#{result}
|
112
|
+
#{result.inspect}
|
110
113
|
EOS
|
111
114
|
raise(ClickAndSend::Errors::UnhandledResponse, message)
|
112
115
|
end
|
@@ -80,19 +80,23 @@ describe ClickAndSend::Request do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
describe "error handling" do
|
84
|
+
before { klass.any_instance.stub(:extra_request_xml) }
|
85
|
+
|
86
|
+
context "keys undefined" do
|
87
|
+
it "raises NotImplemented" do
|
88
|
+
expect { subject }.to raise_error { |e| # warning: do..end block gives false positive
|
89
|
+
e.should be_a(ClickAndSend::Errors::UnhandledResponse)
|
90
|
+
e.message.should include('ClickAndSend::Errors::NotImplemented')
|
91
|
+
}
|
92
|
+
end
|
89
93
|
end
|
90
|
-
end
|
91
94
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
95
|
+
context "missing key" do
|
96
|
+
before { klass.send(:define_method, :keys) { {} } }
|
97
|
+
it "raises KeyError" do
|
98
|
+
expect { subject }.to raise_error(ClickAndSend::Errors::UnhandledResponse)
|
99
|
+
end
|
96
100
|
end
|
97
101
|
end
|
98
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: click_and_send
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -178,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: '0'
|
179
179
|
segments:
|
180
180
|
- 0
|
181
|
-
hash:
|
181
|
+
hash: -397625648343678498
|
182
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
183
|
none: false
|
184
184
|
requirements:
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
segments:
|
189
189
|
- 0
|
190
|
-
hash:
|
190
|
+
hash: -397625648343678498
|
191
191
|
requirements: []
|
192
192
|
rubyforge_project:
|
193
193
|
rubygems_version: 1.8.24
|