Class: RSpec::ComposableJSONMatchers::Configuration
- Inherits:
-
Object
- Object
- RSpec::ComposableJSONMatchers::Configuration
- Defined in:
- lib/rspec/composable_json_matchers/configuration.rb
Constant Summary collapse
- DEFAULT_PARSER_OPTIONS =
The default value of .parser_options.
{ symbolize_names: true }.freeze
Instance Method Summary collapse
-
#parser_options ⇒ Hash
Returns the current options for JSON.parse used in the
be_json
matcher. -
#parser_options=(hash)
Set the given hash as the option for JSON.parse used in the
be_json
matcher.
Instance Method Details
#parser_options ⇒ Hash
Returns the current options for JSON.parse used in the be_json
matcher.
19 20 21 |
# File 'lib/rspec/composable_json_matchers/configuration.rb', line 19 def @parser_options ||= DEFAULT_PARSER_OPTIONS end |
#parser_options=(hash)
This method returns an undefined value.
Set the given hash as the option for JSON.parse used in the be_json
matcher.
33 34 35 36 |
# File 'lib/rspec/composable_json_matchers/configuration.rb', line 33 def (hash) raise ArgumentError, 'You must pass a hash to `parser_options=`.' unless hash.is_a?(Hash) @parser_options = hash end |