push
travis-ci
1016 of 1054 relevant lines covered (96.39%)
3000.53 hits per line
1 |
require 'savon/wsdl/port'
|
4✔ |
2 |
|
|
3 |
class Savon |
4✔ |
4 |
class WSDL |
4✔ |
5 |
class Service |
4✔ |
6 |
|
|
7 |
def initialize(service_node) |
4✔ |
8 |
@service_node = service_node
|
748✔ |
9 |
end
|
|
10 |
|
|
11 |
def name |
4✔ |
12 |
@service_node['name'] |
× |
13 |
end
|
|
14 |
|
|
15 |
def ports |
4✔ |
16 |
@ports ||= ports!
|
908✔ |
17 |
end
|
|
18 |
|
|
19 |
private |
4✔ |
20 |
|
|
21 |
def ports! |
4✔ |
22 |
ports = {} |
552✔ |
23 |
|
|
24 |
@service_node.element_children.each do |port_node| |
552✔ |
25 |
next unless port_node.name == 'port' |
860✔ |
26 |
|
|
27 |
soap_node = port_node.element_children.find { |node| |
1,008✔ |
28 |
namespace = node.namespace.href |
1,008✔ |
29 |
|
|
30 |
soap_1_1 = namespace == Savon::NS_SOAP_1_1 |
1,008✔ |
31 |
soap_1_2 = namespace == Savon::NS_SOAP_1_2 |
1,008✔ |
32 |
address = node.name == 'address'
|
1,008✔ |
33 |
|
|
34 |
(soap_1_1 || soap_1_2) && address |
1,008✔ |
35 |
} |
|
36 |
|
|
37 |
next unless soap_node |
813✔ |
38 |
|
|
39 |
port_name = port_node['name']
|
780✔ |
40 |
port = Port.new(port_node, soap_node)
|
780✔ |
41 |
|
|
42 |
ports[port_name] = port |
780✔ |
43 |
end
|
|
44 |
|
|
45 |
ports |
552✔ |
46 |
end
|
|
47 |
|
|
48 |
end
|
|
49 |
end
|
|
50 |
end
|