Sha256: df3219d951d580478d5048003d31ecef24f5369ce7bfeb77a8c161bf1a3bef82

Contents?: true

Size: 1.24 KB

Versions: 7344

Compression:

Stored size: 1.24 KB

Contents

require 'rspec/expectations'

module RSpec
  module Matchers
    # Matchers for testing RSpec matchers. Include them with:
    #
    #     require 'rspec/matchers/fail_matchers'
    #     RSpec.configure do |config|
    #       config.include RSpec::Matchers::FailMatchers
    #     end
    #
    module FailMatchers
      # Matches if an expectation fails
      #
      # @example
      #   expect { some_expectation }.to fail
      def fail(&block)
        raise_error(RSpec::Expectations::ExpectationNotMetError, &block)
      end

      # Matches if an expectation fails with the provided message
      #
      # @example
      #   expect { some_expectation }.to fail_with("some failure message")
      #   expect { some_expectation }.to fail_with(/some failure message/)
      def fail_with(message)
        raise_error(RSpec::Expectations::ExpectationNotMetError, message)
      end

      # Matches if an expectation fails including the provided message
      #
      # @example
      #   expect { some_expectation }.to fail_including("portion of some failure message")
      def fail_including(*snippets)
        raise_error(
          RSpec::Expectations::ExpectationNotMetError,
          a_string_including(*snippets)
        )
      end
    end
  end
end

Version data entries

7,344 entries across 7,258 versions & 125 rubygems

Version Path
cybrid_api_organization_ruby-0.123.124 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.124 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_organization_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_organization_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_organization_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_organization_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/rspec-expectations-3.11.0/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_organization_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_bank_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb
cybrid_api_id_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib/rspec/matchers/fail_matchers.rb