shapewear 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0
4
+ * Added specs and fixed basic support for SOAP:Fault.
5
+
6
+ ## 0.0.6
7
+ * Added basic support for SOAP:Fault.
8
+
3
9
  ## 0.0.5
4
10
  * Removed the dual-namespace option. Now there's only one.
5
11
  * Generating WSDL for SOAP 1.2;
@@ -72,8 +72,8 @@ module Shapewear::Request
72
72
  xb.Envelope :xmlns => namespaces['env'] do |xenv|
73
73
  xenv.Body do |xbody|
74
74
  xbody.Fault do |xf|
75
- xf.faultcode e.class.name
76
- xf.faultstring e.message
75
+ xf.faultcode ex.class.name
76
+ xf.faultstring ex.message
77
77
  end
78
78
  end
79
79
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Shapewear
4
4
 
5
- Version = "0.0.6"
5
+ Version = "0.1.0"
6
6
 
7
7
  end
@@ -6,22 +6,34 @@ describe Shapewear do
6
6
  describe "usage with SOAP clients" do
7
7
  before do
8
8
  stub_request(:get, "http://services.example.com/complete/soap/wsdl") \
9
- .to_return :body => CompleteService.to_wsdl, :headers => {'Content-Type' => 'application/xml'}
9
+ .to_return :body => CompleteService.to_wsdl, :headers => { 'Content-Type' => 'application/xml' }
10
10
 
11
11
  stub_request(:post, "http://services.example.com/complete/soap") \
12
- .to_return :body => lambda { |r| CompleteService.serve(r) }, :headers => {'Content-Type' => 'application/xml'}
12
+ .to_return :body => lambda { |r| CompleteService.serve(r) }, :headers => { 'Content-Type' => 'application/xml' }
13
13
  end
14
14
 
15
- it "should work with Savon" do
16
- client = Savon::Client.new 'http://services.example.com/complete/soap/wsdl'
17
- response = client.request :echo_in_uppercase, :xmlns => 'http://services.example.com/v1' do
18
- soap.body = {:text => 'uppercase text'}
15
+ describe "Savon" do
16
+ it "should work for simple requests" do
17
+ client = Savon::Client.new 'http://services.example.com/complete/soap/wsdl'
18
+ response = client.request :echo_in_uppercase, :xmlns => 'http://services.example.com/v1' do
19
+ soap.body = { :text => 'uppercase text' }
20
+ end
21
+
22
+ puts response.inspect
23
+ puts response.body.inspect
24
+
25
+ response.body[:echo_in_uppercase_response][:body].should == 'UPPERCASE TEXT'
19
26
  end
20
27
 
21
- puts response.inspect
22
- puts response.body.inspect
28
+ it "should raise SOAP:Faults" do
29
+ client = Savon::Client.new 'http://services.example.com/complete/soap/wsdl'
23
30
 
24
- response.body[:echo_in_uppercase_response][:body].should == 'UPPERCASE TEXT'
31
+ expect {
32
+ client.request :get_structured_data, :xmlns => 'http://services.example.com/v1' do
33
+ soap.body = { :id => 55 }
34
+ end
35
+ }.to raise_error Savon::SOAP::Fault, "(RuntimeError) ID must be 0 or 1"
36
+ end
25
37
  end
26
38
  end
27
39
  end
@@ -39,14 +39,6 @@ class CompleteService
39
39
  end
40
40
  end
41
41
 
42
- def reset(chave)
43
- raise "Operação não permitida" if ::Rails.env.production?
44
- c = Conector::Registro.find_by_chave_registro(chave)
45
- c.reset!
46
-
47
- 'ok'
48
- end
49
-
50
42
  class Structured < Struct.new(:text, :random_value, :created_at)
51
43
  def initialize(text)
52
44
  @text = text
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shapewear
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 6
10
- version: 0.0.6
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "F\xC3\xA1bio Batista"