wsdl-reader 0.0.1 → 0.0.2

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.
@@ -1,4 +1,5 @@
1
1
  require "active_support/core_ext/hash/keys"
2
+ require "active_support/core_ext/module/delegation"
2
3
  require "wsdl-reader/version"
3
4
  require "wsdl-reader/error"
4
5
  require "wsdl-reader/parser"
@@ -22,6 +22,10 @@ module WSDL
22
22
  def all_operations
23
23
  self.map { |_, binding| binding.operations.keys }.flatten
24
24
  end
25
+
26
+ def operation?(operation_name)
27
+ any? { |_, binding| binding.operation? operation_name }
28
+ end
25
29
  end
26
30
 
27
31
  class Binding
@@ -14,6 +14,8 @@ module WSDL
14
14
  attr_reader :prefixes, :target_namespace
15
15
  attr_reader :document, :uri
16
16
 
17
+ delegate :get_operations, to: :bindings
18
+
17
19
  def initialize(uri)
18
20
  @uri = uri
19
21
  @types = SOAP::XSD.new()
@@ -1,5 +1,5 @@
1
1
  module Wsdl
2
2
  module Reader
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -36,6 +36,14 @@ describe "WSDL Binding" do
36
36
  it "#all_operations should eql to #get_operations(nil)" do
37
37
  subject.get_operations.should eql subject.all_operations
38
38
  end
39
+
40
+ it "#operation? should return true if any binding include is operation_name" do
41
+ subject.operation?("getFirstName").should be_true
42
+ end
43
+
44
+ it "#operation? should return false if all bindings dont include is operation_name" do
45
+ subject.operation?("not_existing_operation").should be_false
46
+ end
39
47
  end
40
48
 
41
49
  context "WSDL::Reader::Binding" do
@@ -7,7 +7,8 @@ describe "WSDL Parser" do
7
7
  end
8
8
 
9
9
  context "parsing 'spec/fixtures/UserService.wsdl'" do
10
- subject { WSDL::Reader::Parser.new('spec/fixtures/UserService.wsdl') }
10
+ let(:parser) { WSDL::Reader::Parser.new('spec/fixtures/UserService.wsdl') }
11
+ subject { parser }
11
12
 
12
13
  context "attributes types" do
13
14
  it { should be_a WSDL::Reader::Parser }
@@ -51,6 +52,12 @@ describe "WSDL Parser" do
51
52
 
52
53
  its('services.keys') { should eq %w{UserService} }
53
54
  end
55
+
56
+ context "methods" do
57
+
58
+ its(:get_operations) { should eql parser.bindings.get_operations }
59
+
60
+ end
54
61
  end
55
62
 
56
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wsdl-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &22762300 !ruby/object:Gem::Requirement
16
+ requirement: &14889400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *22762300
24
+ version_requirements: *14889400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard-rspec
27
- requirement: &22794860 !ruby/object:Gem::Requirement
27
+ requirement: &14888980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *22794860
35
+ version_requirements: *14888980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &22793880 !ruby/object:Gem::Requirement
38
+ requirement: &14906300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *22793880
46
+ version_requirements: *14906300
47
47
  description: Read WSDL file and parse messages, bindings, portTypes and services
48
48
  email:
49
49
  - a.sozontov@gmail.com