mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-22 22:06:43 +00:00
New installations will get :yaml as it's default with openapi 3 as the version. Old installations will have the key missing and will default to :json with an easy upgrade path.
29 lines
801 B
Ruby
29 lines
801 B
Ruby
require 'rspec/core'
|
|
require 'rswag/specs/example_group_helpers'
|
|
require 'rswag/specs/example_helpers'
|
|
require 'rswag/specs/configuration'
|
|
require 'rswag/specs/railtie' if defined?(Rails::Railtie)
|
|
|
|
module Rswag
|
|
module Specs
|
|
|
|
# Extend RSpec with a swagger-based DSL
|
|
::RSpec.configure do |c|
|
|
c.add_setting :swagger_root
|
|
c.add_setting :swagger_docs
|
|
c.add_setting :swagger_dry_run
|
|
c.add_setting :swagger_format
|
|
c.extend ExampleGroupHelpers, type: :request
|
|
c.include ExampleHelpers, type: :request
|
|
end
|
|
|
|
def self.config
|
|
@config ||= Configuration.new(RSpec.configuration)
|
|
end
|
|
|
|
# Support Rails 3+ and RSpec 2+ (sigh!)
|
|
RAILS_VERSION = Rails::VERSION::MAJOR
|
|
RSPEC_VERSION = RSpec::Core::Version::STRING.split('.').first.to_i
|
|
end
|
|
end
|