savon_spec 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source :rubygems
2
2
  gemspec
3
+
4
+ gem "autotest"
@@ -68,7 +68,7 @@ module Savon
68
68
  attr_reader :soap_action
69
69
 
70
70
  def new_httpi_mock
71
- HTTPI.send(mock_method, :post).with { |http| http.body.include? soap_action }
71
+ HTTPI.send(mock_method, :post).with { |http| http.body =~ /<\/(.+:)?#{soap_action}>/ }
72
72
  end
73
73
 
74
74
  attr_accessor :httpi_mock
@@ -1,7 +1,7 @@
1
1
  module Savon
2
2
  module Spec
3
3
 
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
 
6
6
  end
7
7
  end
@@ -21,12 +21,21 @@ describe Savon::Spec::Mock do
21
21
  client.request :get_user
22
22
  end
23
23
 
24
+ it "should fail when only parts of the SOAP action matched" do
25
+ expect { client.request :get_user_by_id }.to raise_error(
26
+ Mocha::ExpectationError,
27
+ /expected exactly once, not yet invoked: HTTPI.post/
28
+ )
29
+
30
+ teardown_mocks_for_rspec
31
+ end
32
+
24
33
  it "should fail when no SOAP call was made" do
25
34
  expect { verify_mocks_for_rspec }.to raise_error(
26
35
  Mocha::ExpectationError,
27
36
  /expected exactly once, not yet invoked: HTTPI.post/
28
37
  )
29
-
38
+
30
39
  teardown_mocks_for_rspec
31
40
  end
32
41
  end
@@ -42,7 +51,7 @@ describe Savon::Spec::Mock do
42
51
 
43
52
  it "should fail when the SOAP body was not send" do
44
53
  client.request(:get_user)
45
-
54
+
46
55
  expect { verify_mocks_for_rspec }.to raise_error(
47
56
  Mocha::ExpectationError,
48
57
  /expected exactly once, not yet invoked: #<AnyInstance:Savon::SOAP::XML>.body=\(:id => 1\)/
@@ -129,9 +138,9 @@ describe Savon::Spec::Mock do
129
138
  around do |example|
130
139
  Savon::Spec::Fixture.path = "spec/fixtures"
131
140
  savon.expects(:get_user).returns(:success)
132
-
141
+
133
142
  example.run
134
-
143
+
135
144
  Savon::Spec::Fixture.path = nil # reset to default
136
145
  end
137
146
 
@@ -179,10 +188,10 @@ describe Savon::Spec::Mock do
179
188
 
180
189
  it "should just act like there was a SOAP fault if raising errors was disabled" do
181
190
  Savon.raise_errors = false
182
-
191
+
183
192
  response = client.request :get_user
184
193
  response.should be_a_soap_fault
185
-
194
+
186
195
  Savon.raise_errors = true # reset to default
187
196
  end
188
197
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon_spec
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Harrington
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-08 00:00:00 +01:00
18
+ date: 2011-04-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency