alinta-testing 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 736830c9210449472ed8b5ec12b0d43a94590cb456f552daa8c63f66d63e7a0e
4
- data.tar.gz: c1dddaacbb07604921305915b20fb40f4c9ba2c4a496688ea7e745779cf1e9ba
3
+ metadata.gz: d40c0c14d7f19784a46fe5cb43e8171680d03c70053f655575916656c0a99b6b
4
+ data.tar.gz: cde48ca46dfa89419b1490546bc45b5e1864b5da4d479f239a6e95f76d83c23c
5
5
  SHA512:
6
- metadata.gz: 34aed9123ff9f1134b62d68fc60aa54f0bf04ae38ee377c9212c9a7e64cbadc8eb2242936d3aaf5e92d858dbe5acdbf4535ac4d23dd4dcefb26608c6f2a48121
7
- data.tar.gz: fe364f74e54bf1eb57216ec5c806a7f710260b0982d0bd5d32ca4614aeb6f3164b12233bff8c2618c6ceae5bac16a94ea804b1335dbc93f10888ae4a78b333c4
6
+ metadata.gz: 12922eb76b533bfae54a8bdb9d8aebc3ecb1cb300b5f8e985f6a5295ac2560d7f4699e8983032d8832d319c502c3fbfe23a14c7a5a117d4881c3579ae78f16c4
7
+ data.tar.gz: a8e14a9c01ab7b1c9bc0a22badbc14469f73567b9e1348e1453a24e7d4d66465a4fb35481b0a83fb81087fd481e3a072e2860723f8060721f5df521b9968f5cd
@@ -7,31 +7,28 @@ end
7
7
 
8
8
  def get_url_internal(path, endpoint, urlbasepath, apiversion)
9
9
  # remove leading and trailing slashes
10
- path = path.gsub(/^\/?(.*)\/?$/, '\1')
10
+ endpoint = endpoint.gsub(/^(.*?)\/?$/, '\1')
11
+ path = path.gsub(/^\/?(.*?)\/?$/, '\1') unless path.to_s.empty?
12
+ urlbasepath = urlbasepath.gsub(/^\/?(.*?)\/?$/, '\1') unless urlbasepath.to_s.empty?
13
+ apiversion = apiversion.gsub(/^\/?(.*?)\/?$/, '\1') unless apiversion.to_s.empty?
11
14
 
12
- if urlbasepath.to_s.empty?
13
- splitpath = path.split('/')
14
- basepath = splitpath.first()
15
- path = splitpath.drop(1).join('/')
16
- else
17
- basepath = urlbasepath
18
- end
15
+ path = "#{urlbasepath}/#{path}" unless urlbasepath.to_s.empty?
16
+
17
+ splitpath = path.split('/')
18
+ basepath = splitpath.first()
19
+ path = splitpath.drop(1).join('/')
19
20
 
20
21
  # base end point for all calls
21
22
  url = endpoint
22
- url = "#{url}/" unless url.end_with?('/')
23
23
 
24
24
  # common sub-path for this feature
25
- url = "#{url}#{basepath}" unless basepath.to_s.empty?
26
- url = "#{url}/" unless url.end_with?('/')
25
+ url = "#{url}/#{basepath}" unless basepath.to_s.empty?
27
26
 
28
27
  # versioned route for UAT environments
29
- version = apiversion
30
- url = "#{url}#{version}" unless version.to_s.empty?
31
- url = "#{url}/" unless url.end_with?('/')
28
+ url = "#{url}/#{apiversion}" unless apiversion.to_s.empty?
32
29
 
33
30
  # final path for this request
34
- url = "#{url}#{path}" unless path.empty?
31
+ url = "#{url}/#{path}" unless path.to_s.empty?
35
32
 
36
33
  url
37
34
  end
@@ -1,3 +1,3 @@
1
1
  module AlintaTesting
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alinta-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hosking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-21 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-rest-bdd