puffing-billy 0.6.1 → 0.6.2

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: c947cba0ecd347fd64162b9d54f81b554332de78
4
- data.tar.gz: 7f1d4c7bb3b60f1dd38aaeaafbe3ac908e5cbb42
3
+ metadata.gz: 036f99aa36198814c89f3764027a28b63d46e4d3
4
+ data.tar.gz: 14820ad20ea2e08038d8c9ed03921be8058831ac
5
5
  SHA512:
6
- metadata.gz: 2804533a54d46131aaf4545047a84813bea526ddd5129ee72caaf604e700faa55418bd09e5e7bce0abd4981fda98427ddda78b4cb5faf44beb25970e11cecbbb
7
- data.tar.gz: e17d6928069e53f911b01bb64d29eb8a06a447b7688f883d37dfb133e0c05107344c4fa0e4d402dd743b00305dff6a1c0ff6211643e7b7973a160634d62b47fd
6
+ metadata.gz: 5e19c8f782fe8f99743bdb2349123447f7dd8cc6187721facec412650ef12d9d72d9a93155ee2bbcaaf0edfd7084abd61ef4882a6dd2d5e8f721caa96444370b
7
+ data.tar.gz: d1146aef57cad65dec0692f0492d2a662f923213dc7306128c345a627bbad3da45a79dadc26c2a77b0014a3f87b5caffa08c68cc7c86ad431f746d54946b0533
@@ -1,15 +1,23 @@
1
+ v0.6.2, 2015-11-23
2
+ ------------------
3
+
4
+ * Enhanced error output for proxy handling [#125](https://github.com/oesmith/puffing-billy/pull/125)
5
+ * Use options to create webkit driver [#129](https://github.com/oesmith/puffing-billy/pull/129)
6
+ * Billy config and Capybara::Webkit config compatibility [#130](https://github.com/oesmith/puffing-billy/pull/130)
7
+ * Output the request method when proxy returns an error [#134](https://github.com/oesmith/puffing-billy/pull/134)
8
+
1
9
  v0.6.1, 2015-08-25
2
10
  ------------------
3
11
 
4
- * Fix `instance variable not initialized` warnings (#107)
5
- * Add regex support to whitelist (#111)
6
- * Support basic auth in requests (#121)
7
- * Added alternative to run VCR in parallel (#122)
12
+ * Fix `instance variable not initialized` warnings [#107](https://github.com/oesmith/puffing-billy/pull/107)
13
+ * Add regex support to whitelist [#111](https://github.com/oesmith/puffing-billy/pull/111)
14
+ * Support basic auth in requests [#121](https://github.com/oesmith/puffing-billy/pull/121)
15
+ * Added alternative to run VCR in parallel [#122](https://github.com/oesmith/puffing-billy/pull/122)
8
16
 
9
17
  v0.6.0, 2015-08-25
10
18
  ------------------
11
19
 
12
- * Fix uninitalized constant error in Minitest (#109)
20
+ * Fix uninitialized constant error in Minitest (#109)
13
21
  * Add support for customizing Billy proxy host (#112)
14
22
  * Add support for internal proxies (#118)
15
23
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puffing-billy (0.6.1)
4
+ puffing-billy (0.6.2)
5
5
  addressable
6
6
  em-http-request (~> 1.1.0)
7
7
  em-synchrony
data/README.md CHANGED
@@ -250,7 +250,7 @@ that are running on random ports.
250
250
  or 304 status codes. This prevents unauthorized or internal server errors from
251
251
  being cached and used for future test runs.
252
252
 
253
- `c.non_successful_error_level` is used to log when non-successful resposnes are
253
+ `c.non_successful_error_level` is used to log when non-successful responses are
254
254
  received. By default, it just writes to the log file, but when set to `:error`
255
255
  it throws an error with the URL and status code received for easier debugging.
256
256
 
@@ -42,11 +42,11 @@ module Billy
42
42
 
43
43
  if defined?(Capybara::Webkit::Driver)
44
44
  Capybara.register_driver :webkit_billy do |app|
45
- driver = Capybara::Webkit::Driver.new(app)
46
- driver.browser.ignore_ssl_errors
47
- driver.browser.set_proxy(host: Billy.proxy.host,
48
- port: Billy.proxy.port)
49
- driver
45
+ options = {
46
+ ignore_ssl_errors: false,
47
+ proxy: {host: Billy.proxy.host, port: Billy.proxy.port}
48
+ }
49
+ Capybara::Webkit::Driver.new(app, Capybara::Webkit::Configuration.to_hash.merge(options))
50
50
  end
51
51
  end
52
52
 
@@ -33,7 +33,7 @@ module Billy
33
33
 
34
34
  unless allowed_response_code?(response[:status])
35
35
  if Billy.config.non_successful_error_level == :error
36
- return { error: "Request failed due to response status #{response[:status]} for '#{url}' which was not allowed." }
36
+ return { error: "#{method} Request failed due to response status #{response[:status]} for '#{url}' which was not allowed." }
37
37
  else
38
38
  Billy.log(:warn, "puffing-billy: Received response status code #{response[:status]} for '#{url}'")
39
39
  end
@@ -50,6 +50,9 @@ module Billy
50
50
  @signature = EM.start_server('127.0.0.1', Billy.config.proxy_port, ProxyConnection) do |p|
51
51
  p.handler = request_handler
52
52
  p.cache = @cache if defined?(@cache)
53
+ p.errback do |msg|
54
+ Billy.log :error, msg
55
+ end
53
56
  end
54
57
 
55
58
  Billy.log(:info, "puffing-billy: Proxy listening on #{url}")
@@ -7,6 +7,8 @@ require 'em-synchrony'
7
7
 
8
8
  module Billy
9
9
  class ProxyConnection < EventMachine::Connection
10
+ include EventMachine::Deferrable
11
+
10
12
  attr_accessor :handler
11
13
  attr_accessor :cache
12
14
 
@@ -1,3 +1,3 @@
1
1
  module Billy
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -230,17 +230,6 @@ shared_examples_for 'a cache' do
230
230
  end
231
231
 
232
232
  it 'should raise error for non-successful responses when :error' do
233
- # When this config setting is set, the EventMachine running the test servers is killed upon error raising
234
- # The `raise` is required to bubble up the error to the test running it
235
- # The Faraday error is raised upon `close_connection` so this can be non-pending if we can do one of the following:
236
- # 1) Remove the `raise error_message` conditionally for this test
237
- # 2) Restart the test servers if they aren't running
238
- # 3) Change the test servers to start/stop for each test instead of before all
239
- # 4) Remove the test server completely and rely on the server instantiated by the app
240
- pending 'Unable to test this without affecting the running test servers'
241
- # If the 'pending' continues to execute the spec, 'skip' it to avoid EM errors.
242
- # If 'pending' stops the test, 'skip' isn't defined but it won't hit this line.
243
- skip 'Unable to test this without affecting the running test servers'
244
233
  expect { http_error.get('/foo') }.to raise_error(Faraday::Error::ConnectionFailed)
245
234
  end
246
235
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puffing-billy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olly Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-25 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec