smacks-savon 0.1.61 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,35 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "helper")
2
-
3
- class TestSavonService < Test::Unit::TestCase
4
-
5
- include TestHelper
6
- include SoapResponseFixture
7
-
8
- context "Savon::Service" do
9
- setup do
10
- @some_factory = WsdlFactory.new
11
- @some_wsdl = Savon::Wsdl.new(some_uri, http_mock(@some_factory.build))
12
- Savon::Wsdl.stubs(:new).returns(@some_wsdl)
13
-
14
- @service = Savon::Service.new(some_url)
15
- @service.http = service_http_mock(some_soap_response)
16
- @result = @service.findById
17
- end
18
-
19
- should "return a Savon::Response object containing the given response" do
20
- assert_kind_of Savon::Response, @result
21
- assert_equal some_soap_response, @result.to_s
22
- end
23
-
24
- should "return an instance of Savon::Wsdl on wsdl" do
25
- assert_kind_of Savon::Wsdl, @service.wsdl
26
- end
27
-
28
- should "raise an ArgumentError when called with an invalid action" do
29
- assert_raise ArgumentError do
30
- @service.somethingCrazy
31
- end
32
- end
33
- end
34
-
35
- end
@@ -1,52 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "helper")
2
-
3
- class TestSavonWsdl < Test::Unit::TestCase
4
-
5
- include TestHelper
6
-
7
- context "Savon::Wsdl without choice elements" do
8
- setup do
9
- @some_factory = WsdlFactory.new
10
- @some_wsdl = Savon::Wsdl.new(some_uri, http_mock(@some_factory.build))
11
- end
12
-
13
- should "return the namespace_uri" do
14
- assert_equal @some_factory.namespace_uri, @some_wsdl.namespace_uri
15
- end
16
-
17
- should "return the available service_methods" do
18
- assert_equal @some_factory.service_methods.keys, @some_wsdl.service_methods
19
- end
20
-
21
- should "not find any choice elements, so choice_elements returns []" do
22
- assert_equal @some_factory.choice_elements.keys, @some_wsdl.choice_elements
23
- end
24
- end
25
-
26
- context "Savon::Wsdl with choice elements" do
27
- setup do
28
- @choice_factory = WsdlFactory.new(
29
- :service_methods => {"findUser" => ["credential"]},
30
- :choice_elements => {"credential" => ["id", "email"]}
31
- )
32
- @choice_wsdl = Savon::Wsdl.new(some_uri, http_mock(@choice_factory.build))
33
- end
34
-
35
- should "return the available choice elements" do
36
- assert_equal @choice_factory.choice_elements["credential"], @choice_wsdl.choice_elements
37
- end
38
-
39
- should "return the raw SOAP response on to_s" do
40
- assert_equal @choice_factory.build, @choice_wsdl.to_s
41
- end
42
- end
43
-
44
- context "Savon::Wsdl with an invalid (non-WSDL) response" do
45
- should "raise an ArgumentError" do
46
- assert_raise ArgumentError do
47
- Savon::Wsdl.new(some_uri, http_mock("Non-WSDL response"))
48
- end
49
- end
50
- end
51
-
52
- end
data/test/test_savon.rb DELETED
@@ -1,4 +0,0 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), "savon"))
2
- require "test_service"
3
- require "test_wsdl"
4
- require "test_response"