lib/swagalicious.rb in swagalicious-0.4.6 vs lib/swagalicious.rb in swagalicious-0.4.7
- old
+ new
@@ -1,9 +1,14 @@
require "rspec/core"
require_relative "./swagalicious/version"
+begin
+ require "rspec/rails"
+rescue nil
+end
+
class Swagalicious
class Error < StandardError; end
def self.config
@config ||= Swagalicious::Configuration.new(RSpec.configuration)
@@ -22,9 +27,14 @@
::RSpec.configure do |c|
c.add_setting :swagger_format
c.add_setting :swagger_root
c.add_setting :swagger_docs
c.add_setting :swagger_dry_run
+
+ if defined?(Rails) && defined?(RSpec::Rails)
+ c.include RSpec::Rails::RequestExampleGroup, type: :doc
+ end
+
c.extend Swagalicious::ExampleGroupHelpers, type: :doc
c.include Swagalicious::ExampleHelpers, type: :doc
end
end