brine-dsl 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-gemset +1 -0
  3. data/Gemfile.lock +24 -75
  4. data/Rakefile +5 -29
  5. data/brine-dsl.gemspec +3 -5
  6. data/feature_setup.rb +17 -0
  7. data/lib/brine/requester.rb +27 -2
  8. data/lib/brine/step_definitions/request_construction.rb +5 -0
  9. data/lib/brine/test_steps.rb +8 -2
  10. data/lib/brine/type_checks.rb +2 -1
  11. data/lib/brine/util.rb +13 -3
  12. metadata +6 -145
  13. data/.gitignore +0 -3
  14. data/.travis.yml +0 -11
  15. data/CHANGELOG.md +0 -170
  16. data/Guardfile +0 -12
  17. data/LICENSE +0 -21
  18. data/README.adoc +0 -29
  19. data/config/cucumber.yml +0 -2
  20. data/docs/build.gradle +0 -19
  21. data/docs/cookbook.html +0 -643
  22. data/docs/gradle/wrapper/gradle-wrapper.jar +0 -0
  23. data/docs/gradle/wrapper/gradle-wrapper.properties +0 -6
  24. data/docs/gradlew +0 -172
  25. data/docs/gradlew.bat +0 -84
  26. data/docs/guide.html +0 -1220
  27. data/docs/index.html +0 -486
  28. data/docs/specs.html +0 -2066
  29. data/docs/src/cookbook.adoc +0 -160
  30. data/docs/src/guide.adoc +0 -524
  31. data/docs/src/index.adoc +0 -28
  32. data/docs/src/spec.erb +0 -121
  33. data/docs/src/specs.adoc +0 -37
  34. data/features/argument_transforms/boolean.feature +0 -37
  35. data/features/argument_transforms/datetime.feature +0 -45
  36. data/features/argument_transforms/integer.feature +0 -41
  37. data/features/argument_transforms/list.feature +0 -46
  38. data/features/argument_transforms/object.feature +0 -66
  39. data/features/argument_transforms/quoted.feature +0 -41
  40. data/features/argument_transforms/regex.feature +0 -40
  41. data/features/argument_transforms/template.feature +0 -46
  42. data/features/argument_transforms/whitespace.feature +0 -51
  43. data/features/assertions/is_a_valid.feature +0 -184
  44. data/features/assertions/is_empty.feature +0 -67
  45. data/features/assertions/is_equal_to.feature +0 -60
  46. data/features/assertions/is_including.feature +0 -34
  47. data/features/assertions/is_matching.feature +0 -35
  48. data/features/assertions/is_of_length.feature +0 -43
  49. data/features/assignment/parameter.feature +0 -20
  50. data/features/assignment/random.feature +0 -25
  51. data/features/assignment/response_attribute.feature +0 -33
  52. data/features/assignment/timestamp.feature +0 -33
  53. data/features/deprecations/replaced_with.feature +0 -53
  54. data/features/request_construction/basic.feature +0 -29
  55. data/features/request_construction/body.feature +0 -26
  56. data/features/request_construction/clearing.feature +0 -46
  57. data/features/request_construction/headers.feature +0 -94
  58. data/features/request_construction/params.feature +0 -60
  59. data/features/resource_cleanup/cleanup.feature +0 -86
  60. data/features/selectors/all.feature +0 -55
  61. data/features/selectors/any.feature +0 -48
  62. data/features/step_definitions/test_steps.rb +0 -5
  63. data/features/support/env.rb +0 -10
  64. data/tutorial/missing.feature +0 -5
  65. data/tutorial/post_matching.feature +0 -12
  66. data/tutorial/post_status.feature +0 -10
  67. data/tutorial/support/env.rb +0 -2
@@ -1,60 +0,0 @@
1
- @wip
2
- Feature: Adding Query Parameters
3
-
4
- Scenario: Query parameters are added to requests.
5
- Given a file named "features/params.feature" with:
6
-
7
- """
8
- Feature: Request query parameters can be specified.
9
- Scenario: A single parameter is appended to the URL.
10
- Given expected GET sent to `/query?foo=bar`
11
-
12
- When the request query parameter `foo` is assigned `bar`
13
- And a GET is sent to `/query`
14
-
15
- Then expected calls are verified
16
-
17
- Scenario: Multiple parameters are appended to the URL with proper formatting.
18
- Given expected GET sent to `/query?foo=bar&baz=1`
19
-
20
- When the request query parameter `foo` is assigned `bar`
21
- And the request query parameter `baz` is assigned `1`
22
- And a GET is sent to `/query`
23
-
24
- Then expected calls are verified
25
-
26
- Scenario Outline: Values are encoded appropriately.
27
- Given expected GET sent to `/query?foo=<encoded>`
28
-
29
- When the request query parameter `foo` is assigned `<input>`
30
- And a GET is sent to `/query`
31
-
32
- Then expected calls are verified
33
- Examples:
34
- | input | encoded |
35
- | bar & grill | bar+%26+grill |
36
- | + + | %2B+%2B |
37
- | (imbalance)) | %28imbalance%29%29 |
38
-
39
- Scenario Outline: Parametes are added regardless of HTTP method.
40
- Given expected <method> sent to `/query?foo=bar`
41
-
42
- When the request query parameter `foo` is assigned `bar`
43
- And a <method> is sent to `/query`
44
-
45
- Then expected calls are verified
46
- Examples:
47
- | method |
48
- | POST |
49
- | PUT |
50
- | DELETE |
51
- | HEAD |
52
- | OPTIONS |
53
- """
54
-
55
- When I run `cucumber features/params.feature`
56
- Then the output should contain:
57
- """
58
- 10 passed
59
- """
60
- And it should pass
@@ -1,86 +0,0 @@
1
- Feature: Resource Cleanup
2
- Resources created during testing can be marked for deletion.
3
-
4
- Scenario: Initial Success
5
- Given a file named "features/cleanup.feature" with:
6
-
7
- """
8
- Feature: Resource Cleanup
9
-
10
- Scenario: Successful Basic Deletion
11
- Given expected DELETE sent to `/some/path`
12
-
13
- When a resource is created at `/some/path`
14
- """
15
-
16
- When I run `cucumber --strict features/cleanup.feature`
17
- Then the output should match %r<delete http://www.example.com/some/path>
18
- And the output should not contain:
19
- """
20
- ERROR
21
- """
22
- And it should pass
23
-
24
- Scenario: Returned 4xx
25
- Given a file named "features/cleanup_failure.feature" with:
26
-
27
- """
28
- Feature: Resource Cleanup
29
-
30
- Scenario: Failed Deletion
31
- Given expected response status of `409`
32
- And expected DELETE sent to `/some/path`
33
-
34
- When a resource is created at `/some/path`
35
- """
36
-
37
- When I run `cucumber --strict features/cleanup_failure.feature`
38
- Then the output should match %r<(?:.*delete http://www.example.com/some/path.*){3}>
39
- And the output should contain:
40
- """
41
- ERROR
42
- """
43
- And it should pass
44
-
45
- Scenario: Success Upon Retry
46
- Given a file named "features/cleanup_retried.feature" with:
47
-
48
- """
49
- Feature: Resource Cleanup
50
-
51
- Scenario: Success Upon Retry
52
- Given expected response status sequence of `[504, 200]`
53
- And expected DELETE sent to `/some/path`
54
-
55
- When a resource is created at `/some/path`
56
- """
57
-
58
- When I run `cucumber --strict -o ../../out.log features/cleanup_retried.feature`
59
- Then the output should match %r<(?:.*delete http://www.example.com/some/path.*){2}>
60
- And the output should not contain:
61
- """
62
- ERROR
63
- """
64
- And it should pass
65
-
66
-
67
- Scenario: Unreached Success
68
- Given a file named "features/cleanup_unreached.feature" with:
69
-
70
- """
71
- Feature: Resource Cleanup
72
-
73
- Scenario: Unreached Success
74
- Given expected response status sequence of `[504, 504, 504, 200]`
75
- And expected DELETE sent to `/some/path`
76
-
77
- When a resource is created at `/some/path`
78
- """
79
-
80
- When I run `cucumber --strict -o ../../out.log features/cleanup_unreached.feature`
81
- Then the output should match %r<(?:.*delete http://www.example.com/some/path.*){3}>
82
- And the output should contain:
83
- """
84
- ERROR
85
- """
86
- And it should pass
@@ -1,55 +0,0 @@
1
- Feature: All Elements
2
- Assertions can be done against all elements of a structure.
3
-
4
- Scenario: Assorted positive and negative assertions.
5
- Given a file named "features/all.feature" with:
6
- """
7
-
8
- Feature: Allow selection of all structure elements
9
- Scenario: List in response body
10
- When the response body is assigned:
11
- \"\"\"
12
- ["a", "bb", "ccc"]
13
- \"\"\"
14
- Then the value of the response body has elements which are all matching `/\w+/`
15
-
16
- Scenario: Spread nested lists
17
- When the response body is assigned:
18
- \"\"\"
19
- [{"val": "foo"},{"val": "foo"}]
20
- \"\"\"
21
- Then the value of the response body children `..val` has elements which are all equal to `foo`
22
-
23
- """
24
- When I run `cucumber --strict features/all.feature`
25
- Then the output should contain:
26
- """
27
- 4 passed
28
- """
29
- And it should pass
30
-
31
- Scenario: Failing tests since negation isn't available yet.
32
- Given a file named "features/all.feature" with:
33
- """
34
-
35
- Feature: Allow selection of all structure elements
36
- Scenario: List in response body
37
- When the response body is assigned:
38
- \"\"\"
39
- ["a", "bb", "ccc"]
40
- \"\"\"
41
- Then the value of the response body has elements which are all matching `/^\w$/`
42
-
43
- Scenario: Spread nested lists
44
- When the response body is assigned:
45
- \"\"\"
46
- [{"val": "foo"},{"val": "fob"}]
47
- \"\"\"
48
- Then the value of the response body children `..val` has elements which are all equal to `foo`
49
-
50
- """
51
- When I run `cucumber --strict features/all.feature`
52
- Then the output should contain:
53
- """
54
- 2 failed
55
- """
@@ -1,48 +0,0 @@
1
- Feature: Any Element
2
- Assertions can be done against any element of a structure.
3
-
4
- Scenario: Assorted positive and negative assertions.
5
- Given a file named "features/any.feature" with:
6
- """
7
-
8
- Feature: Allow selection of any structure element
9
- Scenario: List in response body
10
- When the response body is assigned:
11
- \"\"\"
12
- ["a", "b", "c"]
13
- \"\"\"
14
- Then the value of the response body does have any element that is equal to `a`
15
- And the value of the response body does not have any element that is equal to `d`
16
-
17
- Scenario: Nested list in response body
18
- When the response body is assigned:
19
- \"\"\"
20
- {"letters": ["a", "b", "c"]}
21
- \"\"\"
22
- Then the value of the response body child `letters` does have any element that is equal to `a`
23
- And the value of the response body child `letters` does not have any element that is equal to `d`
24
-
25
- Scenario: Map matches entries
26
- When the response body is assigned:
27
- \"\"\"
28
- {"a": 1, "b": 2}
29
- \"\"\"
30
- #Equality will match keys
31
- Then the value of the response body does have any element that is equal to `a`
32
- And the value of the response body does not have any element that is equal to `d`
33
-
34
- Scenario: Spread nested lists
35
- When the response body is assigned:
36
- \"\"\"
37
- [{"val":"foo"},{"val":"bar"}]
38
- \"\"\"
39
- Then the value of the response body children `..val` does have any element that is equal to `foo`
40
- And the value of the response body children `..val` does not have any element that is equal to `other`
41
-
42
- """
43
- When I run `cucumber --strict features/any.feature`
44
- Then the output should contain:
45
- """
46
- 4 passed
47
- """
48
- And it should pass
@@ -1,5 +0,0 @@
1
- # the output should contain: is useful for seeing failures
2
- # TODO: Swap this out with standard aruba step
3
- Then(/^it should pass$/) do
4
- expect(last_command_started).to be_successfully_executed
5
- end
@@ -1,10 +0,0 @@
1
- require 'aruba/cucumber'
2
-
3
- Before do
4
- write_file 'features/support/env.rb',
5
- <<-END
6
- require 'brine'
7
- require 'brine/test_steps'
8
- World(brine_mix)
9
- END
10
- end
@@ -1,5 +0,0 @@
1
- Feature: Absent resources return 404s.
2
-
3
- Scenario: A request for a known missing resource.
4
- When a GET is sent to `/bins/brine-absent`
5
- Then the value of the response status is equal to `404`
@@ -1,12 +0,0 @@
1
- Feature: A POST returns a link to the created resource.
2
-
3
- Scenario: A valid post.
4
- When the request body is assigned:
5
- """
6
- {"name": "boolean-setting",
7
- "value": true}
8
- """
9
- And a POST is sent to `/bins`
10
-
11
- Then the value of the response status is equal to `201`
12
- And the value of the response body child `uri` is matching `/https://api.myjson.com/bins/\w+/`
@@ -1,10 +0,0 @@
1
- Feature: A POST returns a 201.
2
-
3
- Scenario: A valid post.
4
- When the request body is assigned:
5
- """
6
- {"name": "boolean-setting",
7
- "value": true}
8
- """
9
- And a POST is sent to `/bins`
10
- Then the value of the response status is equal to `201`
@@ -1,2 +0,0 @@
1
- require 'brine'
2
- World(brine_mix)