webtester 0.1.9 → 0.2.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/test.rb +13 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f737a2baae46e8ac06b238584ec1033d9dc2ee3
4
- data.tar.gz: 1c7f75d845e25bf29ea28e00b73abfec5db0bda7
3
+ metadata.gz: dbb07a87237e87663538e161124eae1fd20b3114
4
+ data.tar.gz: ba2e7fd8df186ffb5bf70eb0c4aabec9040fb174
5
5
  SHA512:
6
- metadata.gz: 68d15cc13de617bd363ac8e072ae993df4960c8e22171c68fec689cbcb8b7825181853d609bccaf7e8335c1111ff20f4c5eff69439bc7ef727aa59629db664a0
7
- data.tar.gz: 312080b5d22c7240bd690479d44af8540ff8c823699eab6d3b0f13152ef67bce0dcfa07dd9f9e29ab95a0dff5e65dbb904ac93a9e5d2975078bf2dce4bf2f095
6
+ metadata.gz: 3237a6302923c6d5f258c1789ade2d2fa051b13a07c51ec59099e646bd0532220d5650aa1f720b47d92c1fd83576e076e5f781cc21563b59ee993907761721c2
7
+ data.tar.gz: 9f5a813f03672321c8192b73c9538ea93341db30f072659556dd128b61b08ee56fa0c02bf5bb13d18ff746334ba87efa6364271d45ca2e8c2a56ea998bc6a557
data/lib/test.rb CHANGED
@@ -73,12 +73,21 @@ module WT
73
73
  type = yaml_request['type']
74
74
  url = yaml_request['url']
75
75
  body = yaml_request['body'] || {}
76
-
77
- proxy_parts = yaml_request['proxy'].split(':') if yaml_request['proxy']
76
+ proxy = yaml_request['proxy']
78
77
 
79
78
  request = WT::Request.new(type, url, body)
80
- request.proxy_host = proxy_parts[0] if proxy_parts
81
- request.proxy_port = proxy_parts[1] if proxy_parts
79
+
80
+ if proxy
81
+ begin
82
+ proxy['http://'] = ''
83
+ proxy_parts = proxy.split(':')
84
+ rescue
85
+ end
86
+
87
+ request.proxy_host = proxy_parts[0] if proxy_parts
88
+ request.proxy_port = proxy_parts[1] if proxy_parts
89
+ end
90
+
82
91
  request
83
92
  end
84
93
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webtester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego F. Nascimento
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-01 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " A simple API to create HTTP Request tests. "
14
14
  email: diego.fnascimento@gmail.com