alinta-cucumber-rest-bdd 0.5.12 → 0.5.13

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
  SHA1:
3
- metadata.gz: de06d1274be3181813ecac8a6a5484e0093a8d19
4
- data.tar.gz: f894522b5c21927e4174895fe8d5ba72b2d44e40
3
+ metadata.gz: 610695a318a73bf3a5d27dbdbce1c54ae55cba3b
4
+ data.tar.gz: 7c31d375827a30d491ef759de922e15536c07ef5
5
5
  SHA512:
6
- metadata.gz: f122fa70bd1c5f1e257a3300fd2418eb966e08e393a1aead8c7e34cd5503a52e3a776501ffb3185507c1e1f7b893d27946094c1cdca36d773aa25f252fd8b102
7
- data.tar.gz: cf7da774081ce9ad5bfecf9e543fa16d3348fb0f1a9c6d4467368461efd5f0b491b147b83e98a04d243caa439370d323db36189e5e5b090a402edbed56d5ebc2
6
+ metadata.gz: 1b5112996012f6f391b374d30d6045456839a8b4ad8c64588ba7262002e133af2e03227ad27e3f16d9f6a72dc98ef51d5f6e009b11cb73dc8430b80981a20b22
7
+ data.tar.gz: ed2d4ae5a8063f31283506be1b1b2eb2546e9747a693aa3ebc4bd5fbafd360c319a3449f4a3c030d2cef202777be117cbbf1e22ec80709ce6d371f6e2795873d
@@ -13,6 +13,10 @@ Given(/^I am a client$/) do
13
13
  }
14
14
  end
15
15
 
16
+ Given(/^I am issuing requests for (.+?)$/) do |resource|
17
+ @urlbasepath = get_resource(resource)
18
+ end
19
+
16
20
  # GET
17
21
 
18
22
  When(/^I request (?:an?(?! list)|the) ([^"]+?)(?: with (?:key|id))? "([^"]*)"(#{LEVELS})?$/) do |resource, id, levels|
@@ -1,4 +1,7 @@
1
1
  def get_url(path)
2
2
  raise %/Please set an 'endpoint' environment variable provided with the url of the api/ if !ENV.has_key?('endpoint')
3
- url = %/#{ENV['endpoint']}#{path}/
3
+ url = ENV['endpoint']
4
+ url = "#{url}/" unless url.end_with?("/")
5
+ url = "#{url}#{@urlbasepath}/" unless @urlbasepath.to_s.empty?
6
+ url = "#{url}#{path}" unless path.empty?
4
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alinta-cucumber-rest-bdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.12
4
+ version: 0.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Bragg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-20 00:00:00.000000000 Z
12
+ date: 2018-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alinta-cucumber-api