proxy_rb 0.9.0 → 0.9.1

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: 700fef6b3c45edf77d464691d35ce622a011345a
4
- data.tar.gz: aed87998d986f086e57db2ad93cb1a1ec198ec8b
3
+ metadata.gz: db2b6b006763313a39081d93fc12f396121c3eed
4
+ data.tar.gz: db163862c51a5bac75d724b30de5e06606531bc9
5
5
  SHA512:
6
- metadata.gz: e41ec2bb566cc4ec3afcb9ee3abce78ac7b7679ac5809c819ac07122b5c3b0a196b27e38ac0e7ff67466204e9aaabbe28b4ef1dc52a014e01c645b82c263bb55
7
- data.tar.gz: 6857309b09f3aa44cc20d70c2a0265ccdad5f76bbdb3d03684cebeb85506e373eb1019c798624b99f3525868dd1d5e3b23e6c95dee770d18352537f247c68ea4
6
+ metadata.gz: c49f214fbf0d2934182d0b040dd955c495c64ed0ffe0e77d01bb1772acfd84401b829ef7a43772f4126d28e518bd053c742f5e1726b0f4f5984214bfac899e00
7
+ data.tar.gz: a35c9ea6dd29b1e260af715515be72eb923179c9df5c37ca63ca3cb654e24b26abf8e1e9b7b86e2f6e787461e4204c2cafb129da6632e917bc35bfd8d3a63166
data/History.md CHANGED
@@ -4,41 +4,45 @@ Empty
4
4
 
5
5
  # RELEASED
6
6
 
7
- ## [v0.9.0](https://github.com/cucumber/aruba/compare/v0.8.3...v0.9.0)
7
+ ## [v0.9.1](https://github.com/fedux-org/proxy_rb/compare/v0.9.0...v0.9.1)
8
+
9
+ * Added initializer for cucumber which I forgot to add earlier
10
+
11
+ ## [v0.9.0](https://github.com/fedux-org/proxy_rb/compare/v0.8.3...v0.9.0)
8
12
 
9
13
  * Added some step definitions for cucumber
10
14
 
11
- ## [v0.8.3](https://github.com/cucumber/aruba/compare/v0.8.2...v0.8.3)
15
+ ## [v0.8.3](https://github.com/fedux-org/proxy_rb/compare/v0.8.2...v0.8.3)
12
16
 
13
17
  * Make warning appear once
14
18
 
15
- ## [v0.8.2](https://github.com/cucumber/aruba/compare/v0.8.1...v0.8.2)
19
+ ## [v0.8.2](https://github.com/fedux-org/proxy_rb/compare/v0.8.1...v0.8.2)
16
20
 
17
21
  * Added warning if one disables `strict`-mode which was
18
22
 
19
- ## [v0.8.1](https://github.com/cucumber/aruba/compare/v0.8.0...v0.8.1)
23
+ ## [v0.8.1](https://github.com/fedux-org/proxy_rb/compare/v0.8.0...v0.8.1)
20
24
 
21
25
  * Handle drivers - like `capybara-selenium` which currently not support
22
26
  `#response_headers` on `page.driver.response_headers`.
23
27
 
24
- ## [v0.8.0](https://github.com/cucumber/aruba/compare/v0.7.1...v0.8.0)
28
+ ## [v0.8.0](https://github.com/fedux-org/proxy_rb/compare/v0.7.1...v0.8.0)
25
29
 
26
30
  * Introduce `strict` option to make it possible to be more relaxed in matchers
27
31
  when the response is not readable, this can lead to status_code == 0
28
32
 
29
- ## [v0.7.1](https://github.com/cucumber/aruba/compare/v0.7.0...v0.7.1)
33
+ ## [v0.7.1](https://github.com/fedux-org/proxy_rb/compare/v0.7.0...v0.7.1)
30
34
 
31
35
  * Handle nil as input for `#simple_table`
32
36
 
33
- ## [v0.7.0](https://github.com/cucumber/aruba/compare/v0.6.0...v0.7.0)
37
+ ## [v0.7.0](https://github.com/fedux-org/proxy_rb/compare/v0.6.0...v0.7.0)
34
38
 
35
39
  * Make simple_table-formatter available as method
36
40
 
37
- ## [v0.6.0](https://github.com/cucumber/aruba/compare/v0.5.0...v0.6.0)
41
+ ## [v0.6.0](https://github.com/fedux-org/proxy_rb/compare/v0.5.0...v0.6.0)
38
42
 
39
43
  * Added announcer for response headers
40
44
 
41
- ## [v0.5.0](https://github.com/cucumber/aruba/compare/v0.4.0...v0.5.0)
45
+ ## [v0.5.0](https://github.com/fedux-org/proxy_rb/compare/v0.4.0...v0.5.0)
42
46
 
43
47
  * Added initializer to bootstrap `proxy_prb`
44
48
  * Improved documentation
@@ -49,6 +53,6 @@ Empty
49
53
  * Addd new matchers to output better error messages
50
54
 
51
55
 
52
- ## [v0.4.0](https://github.com/cucumber/aruba/compare/v0.1.0...v0.4.0)
56
+ ## [v0.4.0](https://github.com/fedux-org/proxy_rb/compare/v0.1.0...v0.4.0)
53
57
 
54
58
  * Added support for `poltergeist`, `selenium` and `webkit`
data/README.md CHANGED
@@ -26,7 +26,13 @@ Or install it yourself as:
26
26
 
27
27
  ## Usage
28
28
 
29
- ### Getting started
29
+ Please have a look at the
30
+ ["features/getting_started"](features/getting_started)-directory for more
31
+ information about that topic. You may need to adjust the specs/features
32
+ according to your setup. And please, also read [Caveats](#caveats) as there
33
+ some limitations - e.g. no support for NTML and Kerberos.
34
+
35
+ ### Getting started with "proxy_rb" and "rspec"
30
36
 
31
37
  The following steps are only a suggestion. If you normally use a different
32
38
  workflow, this is ok. Just make sure, that the `proxy_rb/rspec`-file is
@@ -76,9 +82,48 @@ RSpec.describe 'My Proxy' do
76
82
  end
77
83
  ~~~
78
84
 
79
- Please have a look at the
80
- ["features/getting_started"](features/getting_started)-directory for more
81
- information about that topic.
85
+ *Run command*
86
+
87
+ Then run `rspec`.
88
+
89
+ ### Getting started with "proxy_rb" and "cucumber"
90
+
91
+ The following steps are only a suggestion. If you normally use a different
92
+ workflow, this is ok. Just make sure, that the `proxy_rb/cucumber`-file is
93
+ required by `cucumber` directly or indirectly.
94
+
95
+ *Initialize cucumber*
96
+
97
+ ~~~bash
98
+ bundle exec cucumber --init
99
+ ~~~
100
+
101
+ *Load library*
102
+
103
+ Create a file named `features/support/proxy_rb.rb`.
104
+
105
+ ~~~ruby
106
+ require 'proxy_rb/cucumber'
107
+ ~~~
108
+
109
+ *Create first Tests*
110
+
111
+ Create a file named `features/result.feature`.
112
+
113
+ ~~~ruby
114
+ Feature: Test the result code of a request
115
+ Scenario: Request is allowed
116
+ Given I use the following proxies:
117
+ | proxy |
118
+ | http://localhost:8080 |
119
+ Then the following requests are allowed to pass the proxy:
120
+ | url |
121
+ | http://example.com |
122
+ ~~~
123
+
124
+ *Run command*
125
+
126
+ Then run `cucumber`.
82
127
 
83
128
  ### Getting on with "proxy_rb"
84
129
 
data/lib/proxy_rb/cli.rb CHANGED
@@ -19,7 +19,7 @@ module ProxyRb
19
19
  end
20
20
 
21
21
  desc 'init', 'Initialize proxy_rb'
22
- option :test_framework, default: 'rspec', enum: %w(rspec), desc: 'Choose which test framework to use'
22
+ option :test_framework, default: 'rspec', enum: %w(rspec cucumber), desc: 'Choose which test framework to use'
23
23
  def init
24
24
  ProxyRb::Initializer.new.call(options[:test_framework])
25
25
  end
@@ -34,29 +34,6 @@ module ProxyRb
34
34
  end
35
35
  end
36
36
 
37
- # ProxyRb
38
- module ProxyRb
39
- # Initializers
40
- module Initializers
41
- # Default Initializer
42
- #
43
- # This handles invalid values for initializer.
44
- #
45
- # @private
46
- class FailingInitializer
47
- class << self
48
- def match?(*)
49
- true
50
- end
51
-
52
- def start(*)
53
- raise ArgumentError, %(Unknown test framework. Please use "rspec" )
54
- end
55
- end
56
- end
57
- end
58
- end
59
-
60
37
  # ProxyRb
61
38
  module ProxyRb
62
39
  # Initializer
@@ -98,6 +75,33 @@ module ProxyRb
98
75
  end
99
76
  end
100
77
 
78
+ # ProxyRb
79
+ module ProxyRb
80
+ # Initializer
81
+ module Initializers
82
+ # Add proxy_rb + rspec to project
83
+ #
84
+ # @private
85
+ class CucumberInitializer < Thor::Group
86
+ include Thor::Actions
87
+
88
+ no_commands do
89
+ def self.match?(framework)
90
+ :cucumber == framework.downcase.to_sym
91
+ end
92
+ end
93
+
94
+ def create_helper; end
95
+
96
+ def create_support_file
97
+ create_file 'features/support/proxy_rb.rb', <<~EOS
98
+ require 'proxy_rb/cucumber'
99
+ EOS
100
+ end
101
+ end
102
+ end
103
+ end
104
+
101
105
  # ProxyRb
102
106
  module ProxyRb
103
107
  # The whole initializer
@@ -115,6 +119,7 @@ module ProxyRb
115
119
  def initialize
116
120
  @initializers = []
117
121
  @initializers << Initializers::RSpecInitializer
122
+ @initializers << Initializers::CucumberInitializer
118
123
  end
119
124
 
120
125
  # Create files etc.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # Main Module
3
3
  module ProxyRb
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxy_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer