Top Level Namespace
Defined Under Namespace
Modules: Brine Classes: DelayedStubResponse, ResponseStatusSequenceStubBuilder, StubBuilder, StubRequest, StubResponse
Instance Method Summary collapse
-
#brine_mix ⇒ module
Load all Brine files into the World.
- #build_stub ⇒ Object
-
#grave_param ⇒ Object
Transform grave accent delimited parameters, performing implicit type transformation.
-
#http_method ⇒ Object
Extract the text for a standard HTTP method.
-
#maybe_not ⇒ Object
Indicate whether not is present.
-
#response_attribute(attribute) ⇒ Object
Extract the text for a supported response attribute.
- #stub ⇒ Object
-
#traversal ⇒ Object
Produce a Traversal for one or all elements at the specified path.
Instance Method Details
#brine_mix ⇒ module
Load all Brine files into the World.
Expected to be called as ‘World(brine_mix)`
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/brine.rb', line 13 def brine_mix require 'brine/assertions' require 'brine/cleaning_up' require 'brine/hooks' require 'brine/mustache_expanding' require 'brine/performing' require 'brine/requesting' require 'brine/selecting' require 'brine/transforming' require 'brine/type_checking' Brine end |
#build_stub ⇒ Object
95 96 97 98 |
# File 'lib/brine/test_steps.rb', line 95 def build_stub stub.build($stubs) @stub = nil end |
#grave_param ⇒ Object
Transform grave accent delimited parameters, performing implicit type transformation.
172 173 174 175 176 |
# File 'lib/brine/transforming.rb', line 172 ParameterType( name: 'grave_param', regexp: /`([^`]*)`/, transformer: -> (input) { transformed_parameter(input) } ) |
#http_method ⇒ Object
Extract the text for a standard HTTP method.
223 224 225 226 227 |
# File 'lib/brine/selecting.rb', line 223 ParameterType( name: 'http_method', regexp: /(DELETE|GET|HEAD|OPTIONS|PATCH|POST|PUT)/, transformer: -> (input) { input } ) |
#maybe_not ⇒ Object
Indicate whether not is present.
232 233 234 235 236 |
# File 'lib/brine/selecting.rb', line 232 ParameterType( name: 'maybe_not', regexp: /( not)?/, transformer: -> (input=nil) { !input.nil? } ) |
#response_attribute(attribute) ⇒ Object
Extract the text for a supported response attribute.
205 206 207 |
# File 'lib/brine/selecting.rb', line 205 def response_attribute(attribute) response.send(attribute.to_sym) end |
#stub ⇒ Object
91 92 93 |
# File 'lib/brine/test_steps.rb', line 91 def stub @stub ||= StubBuilder.new end |
#traversal ⇒ Object
Produce a Traversal for one or all elements at the specified path.
253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/brine/selecting.rb', line 253 ParameterType( name: 'traversal', regexp: /(?: child(ren)? `([^`]*)`)?/, transformer: -> (plural_or_path=nil, path=nil) { if path.nil? path=plural_or_path plural_or_path=nil end traversal(path, plural_or_path) } ) |