Method: RSpec::Resources::Util.document_format_hash

Defined in:
lib/rspec/resources/util.rb

.document_format_hash(metadata = nil) ⇒ Object



15
16
17
18
19
20
# File 'lib/rspec/resources/util.rb', line 15

def self.document_format_hash( = nil)
  doc_format = ( || RSpec.current_example.)[:document_format]

  return DOCUMENT_FORMATS[doc_format] if doc_format.is_a?(Symbol) || doc_format.is_a?(String)
  doc_format.respond_to?(:with_indifferent_access) ? doc_format.with_indifferent_access : doc_format
end