Class RSpec::Matchers::Configuration
In: lib/rspec/matchers/configuration.rb
Parent: Object

Provides configuration options for rspec-expectations.

Methods

Constants

NullBacktraceFormatter = Module.new do def self.format_backtrace(backtrace)   @api private

Attributes

backtrace_formatter  [W]  Sets or gets the backtrace formatter. The backtrace formatter should implement `format_backtrace(Array)`. This is used to format backtraces of errors handled by the `raise_error` matcher.

If you are using rspec-core, rspec-core‘s backtrace formatting will be used (including respecting the presence or absence of the `—backtrace` option).

@overload backtrace_formatter

  @return [#format_backtrace] the backtrace formatter

@overload backtrace_formatter=

  @param value [#format_backtrace] sets the backtrace formatter

Public Instance methods

Adds `should` and `should_not` to the given classes or modules. This can be used to ensure `should` works properly on things like proxy objects (particular `Delegator`-subclassed objects on 1.8).

@param [Array<Module>] modules the list of classes or modules

  to add `should` and `should_not` to.

The list of configured syntaxes. @return [Array<Symbol>] the list of configured syntaxes.

Configures the supported syntax. @param [Array<Symbol>, Symbol] values the syntaxes to enable @example

  RSpec.configure do |rspec|
    rspec.expect_with :rspec do |c|
      c.syntax = :should
      # or
      c.syntax = :expect
      # or
      c.syntax = [:should, :expect]
    end
  end

[Validate]