Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
Added some more documentation regarding cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmeyer committed Mar 28, 2016
1 parent 2cff5d7 commit e11d907
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 5 deletions.
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ Or install it yourself as:

## Usage

### Getting started
Please have a look at the
["features/getting_started"](features/getting_started)-directory for more
information about that topic. You may need to adjust the specs/features
according to your setup. And please, also read [Caveats](#caveats) as there
some limitations - e.g. no support for NTML and Kerberos.

### Getting started with "proxy_rb" and "rspec"

The following steps are only a suggestion. If you normally use a different
workflow, this is ok. Just make sure, that the `proxy_rb/rspec`-file is
Expand Down Expand Up @@ -76,9 +82,48 @@ RSpec.describe 'My Proxy' do
end
~~~

Please have a look at the
["features/getting_started"](features/getting_started)-directory for more
information about that topic.
*Run command*

Then run `rspec`.

### Getting started with "proxy_rb" and "cucumber"

The following steps are only a suggestion. If you normally use a different
workflow, this is ok. Just make sure, that the `proxy_rb/cucumber`-file is
required by `cucumber` directly or indirectly.

*Initialize cucumber*

~~~bash
bundle exec cucumber --init
~~~

*Load library*

Create a file named `features/support/proxy_rb.rb`.

~~~ruby
require 'proxy_rb/cucumber'
~~~

*Create first Tests*

Create a file named `features/result.feature`.

~~~ruby
Feature: Test the result code of a request
Scenario: Request is allowed
Given I use the following proxies:
| proxy |
| http://localhost:8080 |
Then the following requests are allowed to pass the proxy:
| url |
| http://example.com |
~~~

*Run command*

Then run `cucumber`.

### Getting on with "proxy_rb"

Expand Down
21 changes: 20 additions & 1 deletion features/getting_started/setup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Setup your project to use "proxy_rb"
And I run `http_proxy` in background
And I run `http_server` in background
Scenario: Setup project
Scenario: Setup project for "rspec"
Given a file named "spec/spec_helper.rb" with:
"""
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
Expand All @@ -32,3 +32,22 @@ Feature: Setup your project to use "proxy_rb"
"""
When I successfully run `rspec`
Then the specs should all pass
Scenario: Setup project for "cucumber"
Given a file named "features/support/proxy_rb.rb" with:
"""
require 'proxy_rb/cucumber'
"""
And a file named "features/result.feature" with:
"""
Feature: Test the result code of a request
Scenario: Request is allowed
Given I use the following proxies:
| proxy |
| http://localhost:8080 |
Then the following requests are allowed to pass the proxy:
| url |
| http://localhost:8000 |
"""
When I successfully run `cucumber`
Then the features should all pass

0 comments on commit e11d907

Please sign in to comment.