Module: OpenapiFirst::Test
- Defined in:
- lib/openapi_first/test.rb,
lib/openapi_first/test/methods.rb
Overview
Defined Under Namespace
Modules: Methods
Classes: NotRegisteredError
Constant Summary
collapse
- DEFINITIONS =
{}.freeze
Class Method Summary
collapse
Class Method Details
.[](api) ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/openapi_first/test.rb', line 17
def self.[](api)
definitions.fetch(api) do
option = api == :default ? '' : ", as: #{api.inspect}"
raise(NotRegisteredError,
"API description '#{api.inspect}' not found." \
"Please call OpenapiFirst::Test.register('myopenapi.yaml'#{option}) " \
'once before calling assert_api_conform.')
end
end
|
.definitions ⇒ Object
11
|
# File 'lib/openapi_first/test.rb', line 11
def self.definitions = DEFINITIONS
|
.register(path, as: :default) ⇒ Object
13
14
15
|
# File 'lib/openapi_first/test.rb', line 13
def self.register(path, as: :default)
definitions[as] = OpenapiFirst.load(path)
end
|