cucumber-varnishtest 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39d4bcc496c7bb96948d20cc14ec16d763e8f29e
4
- data.tar.gz: 24bd3493559ddf26b32b65280c0099368b583ebb
3
+ metadata.gz: 91eddbb4bda1ee81575b91844f4397a012ce7d5a
4
+ data.tar.gz: 31323dc882e618c79621b74775114177f8a0a4f1
5
5
  SHA512:
6
- metadata.gz: b36a2bb13b4a6ccd29db36f5fe2a76c3d55154101da16a5bb669a1469751dd786e10ec1d9122437e3b03b07412623b258858876047ce4bd16d705958e3b9d091
7
- data.tar.gz: aef22699953e61133528e4fea1c321e3fafe7529cc2c2b8c0936c031a831a2afdfe48a64ee883da5d6361f94262bd0dc836e05d5d8ae3e168137d90053eeeadd
6
+ metadata.gz: a43ce239ff222507417576f7a32a691503e5b7e608369f36b4248a5981af57140123474ba4338e6ce16e47ad3e627fa895a96fab1793f1f25d747503713359a1
7
+ data.tar.gz: a752773dc176607f327be16f58c6d03ba6ab5234318bc49bebf007b8f5a4636c402e8d3b2694636f0544fc70228f31a7a048e8165953a1e619b25876b47c4a35
data/README.md CHANGED
@@ -1,22 +1,25 @@
1
- # Varnishtest Cucumber
1
+ # Cucumber Varnishtest
2
2
 
3
3
  This let's you use Gherkin, the language of BDD, to write behavior-level
4
4
  checks for your VCL.
5
5
 
6
6
  ## Project status
7
- This is currently a Proof of Concept.
8
7
 
9
- I think this is probably the easiest/best way to get started with
10
- testing your Varnish config, but it might take a bit of extended as
11
- you test out your use-cases.
8
+ This project is now legit!
12
9
 
13
- Definitely fork and don't rely on this code not changing, though ;)
10
+ Install the [Gem] (https://rubygems.org/gems/cucumber-varnishtest)
11
+ and check out [this example](https://github.com/nstielau/cucumber-varnishtest-example)
12
+ to get started.
14
13
 
15
- I'm working on getting this packaged as a ruby gem to further simplify
16
- the setup for getting testable VCLs. Once it's packaged and versioned
17
- it should be in a sustainable, usable place.
14
+ This is probably the easiest/best way to get started with testing your
15
+ Varnish config. However, the step definitions are not sufficient for
16
+ complicated VCL use-cases. PRs welcome ;)
18
17
 
19
- ## To run
18
+ If you do need to iterate on the steps, working directly out of a clone is
19
+ likely easiest. If you want to get started testing your VCL in CI like travis /
20
+ jenkins / CircleCI, using the steps packaged in the gem is probably easiest.
21
+
22
+ ## Examples
20
23
 
21
24
  To run, simply run `cucumber` from this directory.
22
25
 
@@ -64,33 +67,11 @@ Feature: Static Server Headers
64
67
  0m7.467s
65
68
  ```
66
69
 
67
- ## Installation
70
+ ## Usage
68
71
 
69
72
  Check out [this example](https://github.com/nstielau/cucumber-varnishtest-example).
70
73
 
71
- Add the following line to your Gemfile, preferably in the test or cucumber group:
72
-
73
- ```
74
- gem 'cucumber-varnishtest', :require => false
75
- ```
76
-
77
- Then add the following line to your env.rb to make the step definitions available in your features:
78
-
79
- ```
80
- require 'cucumber/varnishtest'
81
- ```
82
-
83
- ## How to use your own VCL
84
-
85
- Simply put the .vcl file in this directory, and specify in your
86
- `Given` clause of your Scenario:
87
-
88
- ```
89
- Scenario: Multiple Requests without warming
90
- Given varnish running with MyCustomConfig.vcl <==== YOUR VCL FILE
91
- When we request /images.png
92
- Then it should pass varnishtest
93
- ```
74
+ Or simply clone this repo and run `cucumber`
94
75
 
95
76
  ## Dependencies
96
77
 
@@ -0,0 +1 @@
1
+ require './lib/cucumber/varnishtest'
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module Varnishtest
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-varnishtest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Stielau
@@ -38,7 +38,6 @@ files:
38
38
  - Rakefile
39
39
  - cucumber-varnishtest.gemspec
40
40
  - example.vcl
41
- - features/step_definitions/varnish_steps.rb
42
41
  - features/support/env.rb
43
42
  - features/varnishtest.feature
44
43
  - lib/cucumber/varnishtest.rb
@@ -70,6 +69,5 @@ signing_key:
70
69
  specification_version: 4
71
70
  summary: Cucumber steps to easily create and execute varnishtest tests.
72
71
  test_files:
73
- - features/step_definitions/varnish_steps.rb
74
72
  - features/support/env.rb
75
73
  - features/varnishtest.feature
@@ -1,56 +0,0 @@
1
- require './lib/cucumber/varnishtest/context_manager'
2
- require './lib/cucumber/varnishtest/request'
3
-
4
- Given(/^varnish running with (.*)$/) do |vcl_file|
5
- # Load a particular varnish VCL file
6
- ContextManager.instance.vcl_file = vcl_file
7
- end
8
-
9
- When(/^we (GET|PATCH|POST|PUT|DELETE) (.*)$/) do |method, path|
10
- ContextManager.instance.request path, method
11
- end
12
-
13
- Then(/^the response should be 200$/) do
14
- ContextManager.instance.client_expect 'resp.status', 200
15
- end
16
-
17
- Then(/^the response length should be (\d+)$/) do |bytes|
18
- ContextManager.instance.client_expect 'resp.bodylen', bytes.to_i
19
- end
20
-
21
- Then(/^the response header (.*) should be (.*)$/) do |header, value|
22
- ContextManager.instance.client_expect "resp.http.#{header}", "#{value}"
23
- end
24
-
25
- Then(/^it should pass varnishtest$/) do
26
- ContextManager.instance.test!
27
- end
28
-
29
- Then(/^the response code should be (\d+)$/) do |code|
30
- ContextManager.instance.client_expect "resp.status", 200
31
- end
32
-
33
- Then(/^the server should receive (\d+) requests$/) do |count|
34
- ContextManager.instance.expected_request_count = count
35
- end
36
-
37
- Then(/^there should be (\d+) cache hit[s]*$/) do |count|
38
- ContextManager.instance.expected_cache_hits = count
39
- end
40
-
41
- Then(/^there should be (\d+) cache misses$/) do |count|
42
- ContextManager.instance.expected_cache_misses = count
43
- end
44
-
45
- Then(/^there should be (\d+) piped request[s]*$/) do |count|
46
- ContextManager.instance.expected_piped_requests = count
47
- end
48
-
49
- Then(/^there should be (\d+) passed request[s]*$/) do |count|
50
- ContextManager.instance.expected_passed_requests = count
51
- end
52
-
53
- After do |scenario|
54
- # Reset the context manager for a fresh scenario
55
- ContextManager.reset!
56
- end