Module: Rspec::PendingFor — Documentation by YARD 0.9.44

# Module: Rspec::PendingFor

Defined in:
  lib/rspec/pending_for.rb,
  lib/rspec/pending_for/build.rb,
  lib/rspec/pending_for/version.rb,
  lib/rspec/pending_for/engine_or_versions_required.rb

## Overview

Use with Rspec by including in your example groups, just like any other Rspec helpers:

    RSpec.configure do |c|
      c.include Rspec::PendingFor
    end

## Defined Under Namespace

Modules: Version Classes: Build, EngineOrVersionsRequired

## Constant Summary collapse

VERSION =

Current gem version exposed at the traditional constant location.

      Version::VERSION

## Instance Method Summary collapse

- #pending_for(options = {}) ⇒ Object

  How to pend specs that break due to bugs in Ruby interpreters or versions.

- #skip_for(options = {}) ⇒ Object

  How to pend specs that break due to bugs in Ruby interpreters or versions.

## Instance Method Details

### #pending_for(options = {}) ⇒ `Object`

How to pend specs that break due to bugs in Ruby interpreters or versions

    it("blah is blah") do
      pending_for(engine: "ruby", versions: "2.1.5")
      expect("blah").to eq "blah"
    end

Not using named parameters because still supporting Ruby 1.9

Parameters:

- options (`Hash`) (defaults to: `{}`) —

  pending configuration

Options Hash (`options`):

- :engine (`String`, `Symbol`) — default: `"ruby"` —

  Ruby engine name to match, e.g. :ruby, :jruby, :truffleruby

- :versions (`String`, `Range`, `Array<String,Range>`) —

  A single version string or range, or an Array of version specs. Each spec can be:

  - String: exact version match (e.g., “2.7.8”) or “head” for head/dev/SNAPSHOT builds
  - Range<Gem::Version>: inclusive/exclusive bounds respected (e.g., Gem::Version.new(“2.6.0”)…Gem::Version.new(“3.0.0”))
  - Range: compares Ruby major version (e.g., 2..3). Inclusive/exclusive respected. JRuby/TruffleRuby are supported via RUBY_VERSION compatibility for Integer ranges and Gem::Version ranges.
- :reason (`String`) —

  Custom message to display when pending

    41
    42
    43
    # File 'lib/rspec/pending_for.rb', line 41

    def pending_for(options = {})
      modify_example_with(:pending, options)
    end

### #skip_for(options = {}) ⇒ `Object`

How to pend specs that break due to bugs in Ruby interpreters or versions

    it("blah is blah") do
      skip_for(engine: "jruby", versions: "2.2.2")
      expect("blah").to eq "blah"
    end

Not using named parameters because still supporting Ruby 1.9

Parameters:

- options (`Hash`) (defaults to: `{}`) —

  skip configuration

Options Hash (`options`):

- :engine (`String`, `Symbol`) — default: `"ruby"` —

  Ruby engine name to match, e.g. :ruby, :jruby, :truffleruby

- :versions (`String`, `Range`, `Array<String,Range>`) —

  A single version string or range, or an Array of version specs. Each spec can be:

  - String: exact version match (e.g., “2.7.8”) or “head” for head/dev/SNAPSHOT builds
  - Range<Gem::Version>: inclusive/exclusive bounds respected (e.g., Gem::Version.new(“2.6.0”)…Gem::Version.new(“3.0.0”))
  - Range: compares Ruby major version (e.g., 2..3). Inclusive/exclusive respected. JRuby/TruffleRuby are supported via RUBY_VERSION compatibility for Integer ranges and Gem::Version ranges.
- :reason (`String`) —

  Custom message to display when skipping

    63
    64
    65
    # File 'lib/rspec/pending_for.rb', line 63

    def skip_for(options = {})
      modify_example_with(:skip, options)
    end