Class: Skooma::RSpec

Inherits:
Matchers::Wrapper show all
Defined in:
lib/skooma/rspec.rb

Overview

RSpec matchers for OpenAPI schema validation

Examples:

RSpec.configure do |config|
  # ...
  config.include Skooma::RSpec[Rails.root.join("docs", "openapi.yml")], type: :request
end

Defined Under Namespace

Modules: HelperMethods

Constant Summary

Constants inherited from Matchers::Wrapper

Matchers::Wrapper::TEST_REGISTRY_NAME

Instance Attribute Summary

Attributes inherited from Matchers::Wrapper

#coverage, #schema

Instance Method Summary collapse

Constructor Details

#initialize(openapi_path, **params) ⇒ RSpec

Returns a new instance of RSpec.



29
30
31
32
33
34
35
36
37
38
# File 'lib/skooma/rspec.rb', line 29

def initialize(openapi_path, **params)
  super(HelperMethods, openapi_path, **params)

  skooma_self = self
  ::RSpec.configure do |c|
    c.after(:suite) do
      at_exit { skooma_self.coverage.report }
    end
  end
end