dredd_hooks 0.0.1 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -0
- data/LICENSE.txt +3 -3
- data/README.md +100 -26
- data/Rakefile +31 -0
- data/bin/dredd-hooks-ruby +3 -13
- data/doc/README.md +26 -0
- data/features/execution_order.feature +9 -8
- data/features/failing_transaction.feature +1 -0
- data/features/hook_handlers.feature +1 -0
- data/features/multiple_hookfiles.feature +4 -1
- data/features/support/env.rb +2 -5
- data/lib/dredd_hooks.rb +4 -5
- data/lib/dredd_hooks/cli.rb +18 -0
- data/lib/dredd_hooks/definitions.rb +30 -0
- data/lib/dredd_hooks/errors.rb +15 -0
- data/lib/dredd_hooks/file_loader.rb +12 -10
- data/lib/dredd_hooks/methods.rb +43 -37
- data/lib/dredd_hooks/runner.rb +113 -56
- data/lib/dredd_hooks/server.rb +53 -63
- data/lib/dredd_hooks/server/buffer.rb +49 -0
- data/lib/dredd_hooks/server/events_handler.rb +33 -0
- data/lib/dredd_hooks/version.rb +1 -1
- data/spec/integration/definitions_consistency_spec.rb +38 -0
- data/spec/lib/dredd_hooks/methods_spec.rb +62 -0
- data/spec/lib/dredd_hooks/runner_spec.rb +41 -0
- data/spec/lib/dredd_hooks/server/buffer_spec.rb +58 -0
- data/spec/lib/dredd_hooks/server/events_handler_spec.rb +50 -0
- data/spec/spec_helper.rb +35 -0
- metadata +41 -25
- data/.gitignore +0 -15
- data/.travis.yml +0 -9
- data/dredd_hooks.gemspec +0 -25
- data/features/tcp_server.feature +0 -66
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/dredd_hooks.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'dredd_hooks/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "dredd_hooks"
|
8
|
-
spec.version = DreddHooks::VERSION
|
9
|
-
spec.authors = ["Adam Kliment"]
|
10
|
-
spec.email = ["adam@apiary.io"]
|
11
|
-
spec.summary = %q{Ruby Hooks Handler for Dredd API Testing Framework}
|
12
|
-
spec.description = %q{Write Dredd hooks in Ruby to glue together API Blueprint with your Ruby project}
|
13
|
-
spec.homepage = "https://github.com/apiaryio/dredd-hooks-ruby"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "aruba", "~> 0.6.2"
|
24
|
-
spec.add_development_dependency "sinatra", "~> 1.4.5"
|
25
|
-
end
|
data/features/tcp_server.feature
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
Feature: TCP server and messages
|
2
|
-
|
3
|
-
Scenario: TCP server
|
4
|
-
When I run `dredd-hooks-ruby` interactively
|
5
|
-
And I wait for output to contain "Starting"
|
6
|
-
Then It should start listening on localhost port "61321"
|
7
|
-
|
8
|
-
Scenario: Message exchange for event beforeEach
|
9
|
-
Given I run `dredd-hooks-ruby` interactively
|
10
|
-
When I wait for output to contain "Starting"
|
11
|
-
And I connect to the server
|
12
|
-
And I send a JSON message to the socket:
|
13
|
-
"""
|
14
|
-
{"event": "beforeEach", "uuid": "1234-abcd", "data": {"key":"value"}}
|
15
|
-
"""
|
16
|
-
And I send a newline character as a message delimiter to the socket
|
17
|
-
Then I should receive same response
|
18
|
-
And I should be able to gracefully disconnect
|
19
|
-
|
20
|
-
Scenario: Message exchange for event beforeEachValidation
|
21
|
-
Given I run `dredd-hooks-ruby` interactively
|
22
|
-
When I wait for output to contain "Starting"
|
23
|
-
And I connect to the server
|
24
|
-
And I send a JSON message to the socket:
|
25
|
-
"""
|
26
|
-
{"event": "beforeEachValidation", "uuid": "2234-abcd", "data": {"key":"value"}}
|
27
|
-
"""
|
28
|
-
And I send a newline character as a message delimiter to the socket
|
29
|
-
Then I should receive same response
|
30
|
-
And I should be able to gracefully disconnect
|
31
|
-
|
32
|
-
Scenario: Message exchange for event afterEach
|
33
|
-
Given I run `dredd-hooks-ruby` interactively
|
34
|
-
When I wait for output to contain "Starting"
|
35
|
-
And I connect to the server
|
36
|
-
And I send a JSON message to the socket:
|
37
|
-
"""
|
38
|
-
{"event": "afterEach", "uuid": "3234-abcd", "data": {"key":"value"}}
|
39
|
-
"""
|
40
|
-
And I send a newline character as a message delimiter to the socket
|
41
|
-
Then I should receive same response
|
42
|
-
And I should be able to gracefully disconnect
|
43
|
-
|
44
|
-
Scenario: Message exchange for event beforeAll
|
45
|
-
Given I run `dredd-hooks-ruby` interactively
|
46
|
-
When I wait for output to contain "Starting"
|
47
|
-
And I connect to the server
|
48
|
-
And I send a JSON message to the socket:
|
49
|
-
"""
|
50
|
-
{"event": "beforeAll", "uuid": "4234-abcd", "data": {"key":"value"}}
|
51
|
-
"""
|
52
|
-
And I send a newline character as a message delimiter to the socket
|
53
|
-
Then I should receive same response
|
54
|
-
And I should be able to gracefully disconnect
|
55
|
-
|
56
|
-
Scenario: Message exchange for event afterAll
|
57
|
-
Given I run `dredd-hooks-ruby` interactively
|
58
|
-
When I wait for output to contain "Starting"
|
59
|
-
And I connect to the server
|
60
|
-
And I send a JSON message to the socket:
|
61
|
-
"""
|
62
|
-
{"event": "afterAll", "uuid": "5234-abcd", "data": {"key":"value"}}
|
63
|
-
"""
|
64
|
-
And I send a newline character as a message delimiter to the socket
|
65
|
-
Then I should receive same response
|
66
|
-
And I should be able to gracefully disconnect
|