Top Level Namespace
Defined Under Namespace
Modules: Brine, BrineUtil, CleanerUpper, ClientBuilding, Coercion, MustacheBinder, Requesting, Selection, TypeChecking Classes: AllSelector, AnySelector, ClientBuilder, Coercer, DeleteCommand, OAuth2Params, Requester, ResponseStatusSequenceStubBuilder, Selector, StubBuilder, StubRequest, StubResponse, TypeChecks
Constant Summary collapse
- RESPONSE_ATTRIBUTES =
Steps
'(status|headers|body)'- HTTP_METHOD =
Not loaded by default (except in the tests)
'GET|POST|PATCH|PUT|DELETE|HEAD|OPTIONS'- DATE =
Temporal
'\d{4}-\d{2}-\d{2}'- TIME =
'\d{2}:\d{2}:\d{2}'- MILLIS =
'(?:\.\d{3})?'- TZ =
'(?:Z|(?:[+-]\d{2}:\d{2}))'
Instance Method Summary collapse
-
#brine_mix ⇒ Object
Load the files with side effects and return @ref Brine.
-
#brine_root_url ⇒ String
The root url to which Brine will send requests.
- #build_stub ⇒ Object
-
#deprecation_message(version, message) ⇒ Object
Output a deprecation message with contents ‘msg`.
- #dig_from_response(attribute, path = nil, plural = false) ⇒ Object
-
#kv_table(table) ⇒ Object
Return a table that that is a key value pair in a format ready for consumption.
-
#not_if(val) ⇒ Object
This file is legacy or unsorted steps which will be deprecated or moved into more appropriate homes.
-
#oauth2 ⇒ Object
Request construction and response storage.
- #replaced_with(type, new_step, version, multiline = nil) ⇒ Object
- #response_body_child(path = "") ⇒ Object
- #stub ⇒ Object
Instance Method Details
#brine_mix ⇒ Object
Load the files with side effects and return @ref Brine.
Expected to be called as ‘World(brine_mix)`
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/brine.rb', line 33 def brine_mix require 'brine/step_definitions/assignment' require 'brine/step_definitions/request_construction' require 'brine/step_definitions/assertions' require 'brine/step_definitions/cleanup' require 'brine/step_definitions/selection' require 'brine/transforms' require 'brine/rest_steps' require 'brine/hooks' Brine end |
#brine_root_url ⇒ String
19 20 21 22 23 24 25 26 |
# File 'lib/brine/requester.rb', line 19 def brine_root_url if ENV['BRINE_ROOT_URL'] ENV['BRINE_ROOT_URL'] elsif ENV['ROOT_URL'] ('1.0', 'ROOT_URL is deprecated, replace with BRINE_ROOT_URL') if ENV['ROOT_URL'] ENV['ROOT_URL'] end end |
#build_stub ⇒ Object
78 79 80 81 |
# File 'lib/brine/test_steps.rb', line 78 def build_stub stub.build($stubs) @stub = nil end |
#deprecation_message(version, message) ⇒ Object
Output a deprecation message with contents ‘msg`
Nothing will be output if BRINE_QUIET_DEPRECATIONS is set.
43 44 45 |
# File 'lib/brine/util.rb', line 43 def (version, ) warn "DEPRECATION - Removal planned for #{version}: #{}" unless ENV['BRINE_QUIET_DEPRECATIONS'] end |
#dig_from_response(attribute, path = nil, plural = false) ⇒ Object
62 63 64 65 66 |
# File 'lib/brine/selector.rb', line 62 def dig_from_response(attribute, path=nil, plural=false) root = response.send(attribute.to_sym) return root if !path JsonPath.new("$.#{path}").send(plural ? :on : :first, root) end |
#kv_table(table) ⇒ Object
Return a table that that is a key value pair in a format ready for consumption
37 38 39 |
# File 'lib/brine/rest_steps.rb', line 37 def kv_table(table) transform_table!(table).rows_hash end |
#not_if(val) ⇒ Object
This file is legacy or unsorted steps which will be deprecated or moved into more appropriate homes
34 |
# File 'lib/brine/rest_steps.rb', line 34 def not_if(val) val ? :not_to : :to end |
#oauth2 ⇒ Object
Request construction and response storage
6 |
# File 'lib/brine/requester.rb', line 6 require 'oauth2' |
#replaced_with(type, new_step, version, multiline = nil) ⇒ Object
30 31 32 33 |
# File 'lib/brine/util.rb', line 30 def replaced_with(type, new_step, version, multiline=nil) (version, "Replace with: #{type} #{new_step}\n#{multiline}") step new_step, multiline end |
#response_body_child(path = "") ⇒ Object
117 118 119 |
# File 'lib/brine/rest_steps.rb', line 117 def response_body_child(path="") JsonPath.new("$.#{path}").on(response.body.to_json) end |
#stub ⇒ Object
74 75 76 |
# File 'lib/brine/test_steps.rb', line 74 def stub @stub ||= StubBuilder.new end |