Module: OpenapiRuby::Adapters::RSpec::ExampleGroupHelpers
- Defined in:
- lib/openapi_ruby/adapters/rspec.rb
Instance Method Summary collapse
Instance Method Details
#path(template, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/openapi_ruby/adapters/rspec.rb', line 9 def path(template, &block) schema_name = [:openapi_schema_name] context = DSL::Context.new(template, schema_name: schema_name) describe template do # Store context reference on the example group metadata [:openapi_path_context] = context # Evaluate the block which defines operations via get/post/etc. # We need a proxy that captures DSL calls and maps them to RSpec describe blocks proxy = PathProxy.new(self, context) proxy.instance_eval(&block) if block # Register the context for spec generation DSL::MetadataStore.register(context) end end |