julianmorrison-savon 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +92 -0
- data/README.textile +71 -0
- data/Rakefile +27 -0
- data/lib/savon.rb +34 -0
- data/lib/savon/client.rb +84 -0
- data/lib/savon/core_ext.rb +3 -0
- data/lib/savon/core_ext/datetime.rb +8 -0
- data/lib/savon/core_ext/hash.rb +78 -0
- data/lib/savon/core_ext/object.rb +21 -0
- data/lib/savon/core_ext/string.rb +47 -0
- data/lib/savon/core_ext/symbol.rb +8 -0
- data/lib/savon/core_ext/uri.rb +10 -0
- data/lib/savon/request.rb +159 -0
- data/lib/savon/response.rb +108 -0
- data/lib/savon/soap.rb +138 -0
- data/lib/savon/wsdl.rb +122 -0
- data/lib/savon/wsse.rb +122 -0
- data/spec/endpoint_helper.rb +22 -0
- data/spec/fixtures/response/response_fixture.rb +32 -0
- data/spec/fixtures/response/xml/authentication.xml +14 -0
- data/spec/fixtures/response/xml/soap_fault.xml +8 -0
- data/spec/fixtures/response/xml/soap_fault12.xml +18 -0
- data/spec/fixtures/wsdl/wsdl_fixture.rb +37 -0
- data/spec/fixtures/wsdl/xml/authentication.xml +63 -0
- data/spec/fixtures/wsdl/xml/namespaced_actions.xml +307 -0
- data/spec/fixtures/wsdl/xml/no_namespace.xml +115 -0
- data/spec/http_stubs.rb +23 -0
- data/spec/savon/client_spec.rb +83 -0
- data/spec/savon/core_ext/datetime_spec.rb +12 -0
- data/spec/savon/core_ext/hash_spec.rb +134 -0
- data/spec/savon/core_ext/object_spec.rb +40 -0
- data/spec/savon/core_ext/string_spec.rb +68 -0
- data/spec/savon/core_ext/symbol_spec.rb +11 -0
- data/spec/savon/core_ext/uri_spec.rb +15 -0
- data/spec/savon/request_spec.rb +124 -0
- data/spec/savon/response_spec.rb +122 -0
- data/spec/savon/savon_spec.rb +23 -0
- data/spec/savon/soap_spec.rb +131 -0
- data/spec/savon/wsdl_spec.rb +84 -0
- data/spec/savon/wsse_spec.rb +132 -0
- data/spec/spec_helper.rb +16 -0
- metadata +166 -0
@@ -0,0 +1,132 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Savon::WSSE do
|
4
|
+
before do
|
5
|
+
Savon::WSSE.username = nil
|
6
|
+
Savon::WSSE.password = nil
|
7
|
+
Savon::WSSE.digest = false
|
8
|
+
|
9
|
+
@wsse = Savon::WSSE.new
|
10
|
+
@username, @password = "gorilla", "secret"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "contains the namespace for WS Security Secext" do
|
14
|
+
Savon::WSSE::WSENamespace.should be_a(String)
|
15
|
+
Savon::WSSE::WSENamespace.should_not be_empty
|
16
|
+
end
|
17
|
+
|
18
|
+
it "contains the namespace for WS Security Utility" do
|
19
|
+
Savon::WSSE::WSUNamespace.should be_a(String)
|
20
|
+
Savon::WSSE::WSUNamespace.should_not be_empty
|
21
|
+
end
|
22
|
+
|
23
|
+
it "defaults to nil for the WSSE username (global setting)" do
|
24
|
+
Savon::WSSE.username.should be_nil
|
25
|
+
end
|
26
|
+
|
27
|
+
it "has both getter and setter for the WSSE username (global setting)" do
|
28
|
+
Savon::WSSE.username = "gorilla"
|
29
|
+
Savon::WSSE.username.should == "gorilla"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "defaults to nil for the WSSE password (global setting)" do
|
33
|
+
Savon::WSSE.password.should be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it "has both getter and setter for the WSSE password (global setting)" do
|
37
|
+
Savon::WSSE.password = "secret"
|
38
|
+
Savon::WSSE.password.should == "secret"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "defaults to nil for whether to use WSSE digest (global setting)" do
|
42
|
+
Savon::WSSE.digest?.should be_false
|
43
|
+
end
|
44
|
+
|
45
|
+
it "has both getter and setter for whether to use WSSE digest (global setting)" do
|
46
|
+
Savon::WSSE.digest = true
|
47
|
+
Savon::WSSE.digest?.should == true
|
48
|
+
end
|
49
|
+
|
50
|
+
it "defaults to nil for the WSSE username" do
|
51
|
+
@wsse.username.should be_nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "has both getter and setter for the WSSE username" do
|
55
|
+
@wsse.username = "gorilla"
|
56
|
+
@wsse.username.should == "gorilla"
|
57
|
+
end
|
58
|
+
|
59
|
+
it "defaults to nil for the WSSE password" do
|
60
|
+
@wsse.password.should be_nil
|
61
|
+
end
|
62
|
+
|
63
|
+
it "has both getter and setter for the WSSE password" do
|
64
|
+
@wsse.password = "secret"
|
65
|
+
@wsse.password.should == "secret"
|
66
|
+
end
|
67
|
+
|
68
|
+
it "defaults to nil for whether to use WSSE digest" do
|
69
|
+
@wsse.digest?.should be_false
|
70
|
+
end
|
71
|
+
|
72
|
+
it "has both getter and setter for whether to use WSSE digest" do
|
73
|
+
@wsse.digest = true
|
74
|
+
@wsse.digest?.should == true
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "header" do
|
78
|
+
describe "returns the XML for a WSSE authentication header" do
|
79
|
+
it "with WSSE credentials specified" do
|
80
|
+
@wsse.username = @username
|
81
|
+
@wsse.password = @password
|
82
|
+
header = @wsse.header
|
83
|
+
|
84
|
+
header.should include_security_namespaces
|
85
|
+
header.should include(@username)
|
86
|
+
header.should include(@password)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "with WSSE credentials specified via defaults" do
|
90
|
+
Savon::WSSE.username = @username
|
91
|
+
Savon::WSSE.password = @password
|
92
|
+
header = @wsse.header
|
93
|
+
|
94
|
+
header.should include_security_namespaces
|
95
|
+
header.should include(@username)
|
96
|
+
header.should include(@password)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe "returns the XML for a WSSE digest header if specified" do
|
101
|
+
it "via accessors" do
|
102
|
+
@wsse.username = @username
|
103
|
+
@wsse.password = @password
|
104
|
+
@wsse.digest = true
|
105
|
+
header = @wsse.header
|
106
|
+
|
107
|
+
header.should include_security_namespaces
|
108
|
+
header.should include(@username)
|
109
|
+
header.should_not include(@password)
|
110
|
+
end
|
111
|
+
|
112
|
+
it "via defaults" do
|
113
|
+
@wsse.username = @username
|
114
|
+
@wsse.password = @password
|
115
|
+
Savon::WSSE.digest = true
|
116
|
+
header = @wsse.header
|
117
|
+
|
118
|
+
header.should include_security_namespaces
|
119
|
+
header.should include(@username)
|
120
|
+
header.should_not include(@password)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def include_security_namespaces
|
125
|
+
simple_matcher("include security namespaces") do |given|
|
126
|
+
given.should include(Savon::WSSE::WSENamespace)
|
127
|
+
given.should include(Savon::WSSE::WSUNamespace)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "rake"
|
3
|
+
require "spec"
|
4
|
+
require "mocha"
|
5
|
+
require "fakeweb"
|
6
|
+
|
7
|
+
Spec::Runner.configure do |config|
|
8
|
+
config.mock_with :mocha
|
9
|
+
end
|
10
|
+
|
11
|
+
require "savon"
|
12
|
+
Savon::Request.log = false
|
13
|
+
|
14
|
+
FileList["spec/fixtures/**/*.rb"].each { |fixture| require fixture }
|
15
|
+
require "endpoint_helper"
|
16
|
+
require "http_stubs"
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: julianmorrison-savon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.8
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Harrington
|
8
|
+
- Juliano Morrison
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2010-01-01 00:00:00 -02:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: builder
|
18
|
+
type: :runtime
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 2.1.2
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: crack
|
28
|
+
type: :runtime
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.1.4
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
type: :development
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.2.8
|
45
|
+
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: mocha
|
48
|
+
type: :development
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.7
|
55
|
+
version:
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: fakeweb
|
58
|
+
type: :development
|
59
|
+
version_requirement:
|
60
|
+
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.2.7
|
65
|
+
version:
|
66
|
+
description:
|
67
|
+
email: me@rubiii.com
|
68
|
+
executables: []
|
69
|
+
|
70
|
+
extensions: []
|
71
|
+
|
72
|
+
extra_rdoc_files:
|
73
|
+
- README.textile
|
74
|
+
files:
|
75
|
+
- CHANGELOG
|
76
|
+
- Rakefile
|
77
|
+
- README.textile
|
78
|
+
- lib/savon/client.rb
|
79
|
+
- lib/savon/core_ext/datetime.rb
|
80
|
+
- lib/savon/core_ext/hash.rb
|
81
|
+
- lib/savon/core_ext/object.rb
|
82
|
+
- lib/savon/core_ext/string.rb
|
83
|
+
- lib/savon/core_ext/symbol.rb
|
84
|
+
- lib/savon/core_ext/uri.rb
|
85
|
+
- lib/savon/core_ext.rb
|
86
|
+
- lib/savon/request.rb
|
87
|
+
- lib/savon/response.rb
|
88
|
+
- lib/savon/soap.rb
|
89
|
+
- lib/savon/wsdl.rb
|
90
|
+
- lib/savon/wsse.rb
|
91
|
+
- lib/savon.rb
|
92
|
+
- spec/endpoint_helper.rb
|
93
|
+
- spec/fixtures/response/response_fixture.rb
|
94
|
+
- spec/fixtures/wsdl/wsdl_fixture.rb
|
95
|
+
- spec/http_stubs.rb
|
96
|
+
- spec/savon/client_spec.rb
|
97
|
+
- spec/savon/core_ext/datetime_spec.rb
|
98
|
+
- spec/savon/core_ext/hash_spec.rb
|
99
|
+
- spec/savon/core_ext/object_spec.rb
|
100
|
+
- spec/savon/core_ext/string_spec.rb
|
101
|
+
- spec/savon/core_ext/symbol_spec.rb
|
102
|
+
- spec/savon/core_ext/uri_spec.rb
|
103
|
+
- spec/savon/request_spec.rb
|
104
|
+
- spec/savon/response_spec.rb
|
105
|
+
- spec/savon/savon_spec.rb
|
106
|
+
- spec/savon/soap_spec.rb
|
107
|
+
- spec/savon/wsdl_spec.rb
|
108
|
+
- spec/savon/wsse_spec.rb
|
109
|
+
- spec/spec_helper.rb
|
110
|
+
- spec/fixtures/response/xml/authentication.xml
|
111
|
+
- spec/fixtures/response/xml/soap_fault.xml
|
112
|
+
- spec/fixtures/response/xml/soap_fault12.xml
|
113
|
+
- spec/fixtures/wsdl/xml/authentication.xml
|
114
|
+
- spec/fixtures/wsdl/xml/namespaced_actions.xml
|
115
|
+
- spec/fixtures/wsdl/xml/no_namespace.xml
|
116
|
+
has_rdoc: true
|
117
|
+
homepage: http://github.com/JulianMorrison/savon
|
118
|
+
licenses: []
|
119
|
+
|
120
|
+
post_install_message:
|
121
|
+
rdoc_options:
|
122
|
+
- --charset=UTF-8
|
123
|
+
- --title
|
124
|
+
- Savon
|
125
|
+
- --line-numbers
|
126
|
+
- --inline-source
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: "0"
|
134
|
+
version:
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: "0"
|
140
|
+
version:
|
141
|
+
requirements: []
|
142
|
+
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 1.3.5
|
145
|
+
signing_key:
|
146
|
+
specification_version: 3
|
147
|
+
summary: Heavy metal Ruby SOAP client library
|
148
|
+
test_files:
|
149
|
+
- spec/endpoint_helper.rb
|
150
|
+
- spec/fixtures/response/response_fixture.rb
|
151
|
+
- spec/fixtures/wsdl/wsdl_fixture.rb
|
152
|
+
- spec/http_stubs.rb
|
153
|
+
- spec/savon/client_spec.rb
|
154
|
+
- spec/savon/core_ext/datetime_spec.rb
|
155
|
+
- spec/savon/core_ext/hash_spec.rb
|
156
|
+
- spec/savon/core_ext/object_spec.rb
|
157
|
+
- spec/savon/core_ext/string_spec.rb
|
158
|
+
- spec/savon/core_ext/symbol_spec.rb
|
159
|
+
- spec/savon/core_ext/uri_spec.rb
|
160
|
+
- spec/savon/request_spec.rb
|
161
|
+
- spec/savon/response_spec.rb
|
162
|
+
- spec/savon/savon_spec.rb
|
163
|
+
- spec/savon/soap_spec.rb
|
164
|
+
- spec/savon/wsdl_spec.rb
|
165
|
+
- spec/savon/wsse_spec.rb
|
166
|
+
- spec/spec_helper.rb
|