soaspec 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +13 -13
- data/.rspec +3 -3
- data/.travis.yml +5 -5
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +13 -13
- data/Gemfile.lock +97 -87
- data/LICENSE.txt +21 -21
- data/README.md +51 -42
- data/Rakefile +20 -17
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/exe/soaspec-init +142 -142
- data/lib/soaspec.rb +36 -35
- data/lib/soaspec/basic_soap_handler.rb +104 -84
- data/lib/soaspec/common.rb +24 -24
- data/lib/soaspec/exchange.rb +46 -39
- data/lib/soaspec/hash_methods.rb +29 -0
- data/lib/soaspec/matchers.rb +23 -16
- data/lib/soaspec/shared_examples.rb +6 -6
- data/lib/soaspec/tester.rb +31 -31
- data/lib/soaspec/version.rb +3 -3
- data/soaspec.gemspec +32 -32
- data/template/soap_template.xml +9 -9
- metadata +3 -2
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
shared_examples_for 'success scenario' do
|
4
|
-
it 'has status code of 200' do
|
5
|
-
expect(described_class.status_code).to eq 200
|
6
|
-
end
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
shared_examples_for 'success scenario' do
|
4
|
+
it 'has status code of 200' do
|
5
|
+
expect(described_class.status_code).to eq 200
|
6
|
+
end
|
7
7
|
end
|
data/lib/soaspec/tester.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
|
2
|
-
require 'yaml'
|
3
|
-
require_relative 'common'
|
4
|
-
|
5
|
-
module Soaspec
|
6
|
-
# Has basic methods common for methods defining RSpec tests in YAML
|
7
|
-
class Tester
|
8
|
-
|
9
|
-
attr_reader :template_name
|
10
|
-
|
11
|
-
# Load default groups. Set name
|
12
|
-
def initialize(name, options)
|
13
|
-
@name = name
|
14
|
-
end
|
15
|
-
|
16
|
-
def template_name=(name)
|
17
|
-
@request_option = :template
|
18
|
-
@template_name = name
|
19
|
-
end
|
20
|
-
|
21
|
-
protected
|
22
|
-
|
23
|
-
# Log API request and response traffic in 'logs/traffic.log'
|
24
|
-
# @return [Logger] Ruby logger that will log to 'logs/traffic.log'
|
25
|
-
def file_logger
|
26
|
-
logger = Logger.new('logs/traffic.log') # Where request and responses of APIs are stored
|
27
|
-
logger.level = Logger::DEBUG
|
28
|
-
logger
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
1
|
+
|
2
|
+
require 'yaml'
|
3
|
+
require_relative 'common'
|
4
|
+
|
5
|
+
module Soaspec
|
6
|
+
# Has basic methods common for methods defining RSpec tests in YAML
|
7
|
+
class Tester
|
8
|
+
|
9
|
+
attr_reader :template_name
|
10
|
+
|
11
|
+
# Load default groups. Set name
|
12
|
+
def initialize(name, options)
|
13
|
+
@name = name
|
14
|
+
end
|
15
|
+
|
16
|
+
def template_name=(name)
|
17
|
+
@request_option = :template
|
18
|
+
@template_name = name
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
# Log API request and response traffic in 'logs/traffic.log'
|
24
|
+
# @return [Logger] Ruby logger that will log to 'logs/traffic.log'
|
25
|
+
def file_logger
|
26
|
+
logger = Logger.new('logs/traffic.log') # Where request and responses of APIs are stored
|
27
|
+
logger.level = Logger::DEBUG
|
28
|
+
logger
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
32
|
end
|
data/lib/soaspec/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Soaspec
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
1
|
+
module Soaspec
|
2
|
+
VERSION = '0.0.6'
|
3
|
+
end
|
data/soaspec.gemspec
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'soaspec/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'soaspec'
|
8
|
-
spec.version = Soaspec::VERSION
|
9
|
-
spec.authors = ['SamuelGarrattIQA']
|
10
|
-
spec.email = ['samuel.garratt@integrationqa.com']
|
11
|
-
|
12
|
-
spec.summary = %q{Helps to create RSpec specs for SOAP or REST apis }
|
13
|
-
spec.description = %q{Helps to create RSpec specs for SOAP or REST apis. Easily represent multiple requests with
|
14
|
-
the same }
|
15
|
-
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
16
|
-
spec.license = 'MIT'
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
-
f.match(%r{^(test|spec|features)/})
|
20
|
-
end
|
21
|
-
spec.bindir = 'exe'
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ['lib']
|
24
|
-
|
25
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
26
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
-
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
29
|
-
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
30
|
-
spec.add_dependency 'savon', '>= 2' # SOAP
|
31
|
-
|
32
|
-
end
|
1
|
+
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'soaspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'soaspec'
|
8
|
+
spec.version = Soaspec::VERSION
|
9
|
+
spec.authors = ['SamuelGarrattIQA']
|
10
|
+
spec.email = ['samuel.garratt@integrationqa.com']
|
11
|
+
|
12
|
+
spec.summary = %q{Helps to create RSpec specs for SOAP or REST apis }
|
13
|
+
spec.description = %q{Helps to create RSpec specs for SOAP or REST apis. Easily represent multiple requests with
|
14
|
+
the same }
|
15
|
+
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
+
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
29
|
+
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
30
|
+
spec.add_dependency 'savon', '>= 2' # SOAP
|
31
|
+
|
32
|
+
end
|
data/template/soap_template.xml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'>
|
2
|
-
<s12:Body>
|
3
|
-
<ns1:GetWeather xmlns:ns1='http://www.webserviceX.NET'>
|
4
|
-
<!-- optional -->
|
5
|
-
<ns1:CityName><%= test_values[:city_name] || 'Wellington' %></ns1:CityName>
|
6
|
-
<!-- optional -->
|
7
|
-
<ns1:CountryName><%= test_values[:country] || 'New Zealand' %></ns1:CountryName>
|
8
|
-
</ns1:GetWeather>
|
9
|
-
</s12:Body>
|
1
|
+
<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'>
|
2
|
+
<s12:Body>
|
3
|
+
<ns1:GetWeather xmlns:ns1='http://www.webserviceX.NET'>
|
4
|
+
<!-- optional -->
|
5
|
+
<ns1:CityName><%= test_values[:city_name] || 'Wellington' %></ns1:CityName>
|
6
|
+
<!-- optional -->
|
7
|
+
<ns1:CountryName><%= test_values[:country] || 'New Zealand' %></ns1:CountryName>
|
8
|
+
</ns1:GetWeather>
|
9
|
+
</s12:Body>
|
10
10
|
</s12:Envelope>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/soaspec/basic_soap_handler.rb
|
120
120
|
- lib/soaspec/common.rb
|
121
121
|
- lib/soaspec/exchange.rb
|
122
|
+
- lib/soaspec/hash_methods.rb
|
122
123
|
- lib/soaspec/matchers.rb
|
123
124
|
- lib/soaspec/shared_examples.rb
|
124
125
|
- lib/soaspec/tester.rb
|
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
148
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.6.
|
149
|
+
rubygems_version: 2.6.13
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Helps to create RSpec specs for SOAP or REST apis
|