Top Level Namespace
Defined Under Namespace
Modules: TestFrameworkHooks Classes: BugError, ClientErrorDetail, ClientErrorResponse, Hash, Hyperion, HyperionError, HyperionResult, HyperionUri, Multipart, PayloadDescriptor, ResponseDescriptor, RestRoute
Instance Method Summary collapse
-
#fake_route(route, return_value = nil) {|Hyperion::FakeServer::Request| ... } ⇒ Object
A simple wrapper around Hyperion::fake for the typical use case of one faked route.
- #hyperion_raise(msg) ⇒ Object
Instance Method Details
#fake_route(route, return_value = nil) {|Hyperion::FakeServer::Request| ... } ⇒ Object
A simple wrapper around Hyperion::fake for the typical use case of one faked route. The return value can either be specified as an argument or as a function of the request (using the block).
11 12 13 14 15 16 17 18 19 |
# File 'lib/hyperion_test/spec_helper.rb', line 11 def fake_route(route, return_value=nil, &block) if return_value && block fail 'cannot provide both a return_value and block' end block = block || proc{return_value} Hyperion.fake(route.uri.base) do |svr| svr.allow(route, &block) end end |
#hyperion_raise(msg) ⇒ Object
4 5 6 |
# File 'lib/hyperion/types/hyperion_error.rb', line 4 def hyperion_raise(msg) raise HyperionError, msg end |