alinta-testing 0.3.5 → 0.3.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d2e4e269a201c0a8ec77ba11bc4d95710a3d7cba365412ed668c876e9ded278
4
- data.tar.gz: 8aabe3902fea8f09a71fba3eb98f0f8ed5b163ec7ac11fd95470ee9953da2800
3
+ metadata.gz: b11f8dad5d4487ec7077174cff9e578d3efb9a730654528bf8eb3243580efd4d
4
+ data.tar.gz: 1c7af13ec2222564310fb43bda31fc0bb405aa6f6bfe660b49272155afa63fd9
5
5
  SHA512:
6
- metadata.gz: a7c7b8d216751d68f4b29d384f39a011e1fc367d4d84f19c15d18e85bf03ed98882b7891b10bd0281d2be8d1f5214d113fd56cda7054703627a4d133b150bc2e
7
- data.tar.gz: b6605ec0511946468b7db124319e42a433f9b49bbad9b183d28fceca72df1a9ab1a52c87225f92b5accc6c3d49636253fa50a9d833e51dd0ea0cfb2aacfc3a8d
6
+ metadata.gz: 24ead4600f11752a4a3fa41fdc7ea9ed275fe9e8b84e72b1dc67c3aad028d5f7f095b93e23a2c4969b2da238806b59fef191fd57a2a35756fa61481f43e67e6f
7
+ data.tar.gz: de8b6d92d9ddf5d721780a55b48aa9afcdc57d6945d7d77fbbf50ac9161d31e189a376b9f4a10503d2fcb3afd09ae858e59d99a79e803290c576a10c56b45e29
@@ -30,6 +30,16 @@ def parse_attributes(hashes)
30
30
  end
31
31
  end
32
32
 
33
+ def get_url(path)
34
+ raise %(Please set an 'endpoint' environment variable provided with the url of the api) unless ENV.key?('endpoint')
35
+
36
+ url = ENV['endpoint']
37
+ url = "#{url}/" unless url.end_with?('/')
38
+ url = "#{url}#{@urlbasepath}" unless @urlbasepath.to_s.empty?
39
+ url = "#{url}/" unless url.end_with?('/')
40
+ url = "#{url}#{path}" unless path.empty?
41
+ url
42
+ end
33
43
 
34
44
  module RestClient
35
45
 
@@ -91,6 +91,8 @@ end
91
91
  Given("I am issuing versioned requests for {resource_name}") do |resource|
92
92
  version = ENV['api_version']
93
93
  @urlbasepath = resource
94
- @urlbasepath = "#{@urlbasepath}/#{version}/" unless version.to_s.empty?
94
+ @urlbasepath = "#{@urlbasepath}/" unless @urlbasepath.end_with?('/')
95
+ @urlbasepath = "#{@urlbasepath}#{version}/" unless version.to_s.empty?
96
+ @urlbasepath = "#{@urlbasepath}/" unless @urlbasepath.end_with?('/')
95
97
  end
96
98
 
@@ -1,3 +1,3 @@
1
1
  module AlintaTesting
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alinta-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hosking