Skip to content

Commit 55e93bf

Browse files
committed
Ensure that DIRECTORY_MAPPINGS is available
Previous, we just check that `RSpec::Rails` was defined, which it can be yet *not* have `RSpec::Rails::DIRECTORY_MAPPINGS` defined. Lets ensure it is defined.
1 parent 2c8f4df commit 55e93bf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • lib/rspec_api_documentation

lib/rspec_api_documentation/dsl.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require "rspec_api_documentation/dsl/resource"
33
require "rspec_api_documentation/dsl/endpoint"
44
require "rspec_api_documentation/dsl/callback"
5+
require "rspec/support/warnings"
56

67

78
module RspecApiDocumentation
@@ -36,7 +37,7 @@ def resource(*args, &block)
3637
RSpec.configuration.include RspecApiDocumentation::DSL::Callback, :api_doc_dsl => :callback
3738
RSpec.configuration.backtrace_exclusion_patterns << %r{lib/rspec_api_documentation/dsl/}
3839

39-
if defined? RSpec::Rails
40+
if defined? RSpec::Rails::DIRECTORY_MAPPINGS
4041
RSpec::Rails::DIRECTORY_MAPPINGS[:acceptance] = %w[spec acceptance]
4142
RSpec.configuration.infer_spec_type_from_file_location!
4243
end

0 commit comments

Comments
 (0)