Skip to content

3.0.0.beta2

Pre-release
Pre-release
Compare
Choose a tag to compare
@myronmarston myronmarston released this 18 Feb 06:45
· 2603 commits to main since this release

3.0.0.beta2 / 2014-02-17

full changelog

Breaking Changes for 3.0.0:

  • Make mock_with option more strict. Strings are no longer supported
    (e.g. mock_with "mocha") -- use a symbol instead. Also, unrecognized
    values will now result in an error rather than falling back to the
    null mocking adapter. If you want to use the null mocking adapter,
    use mock_with :nothing (as has been documented for a long time).
    (Myron Marston)
  • Remove support for overriding RSpec's built-in :if and :unless
    filters. (Ashish Dixit)
  • Custom formatters are now required to call
    RSpec::Core::Formatters.register(formatter_class, *notifications)
    where notifications is the list of events the formatter wishes to
    be notified about. Notifications are handled by methods matching the
    names on formatters. This allows us to add or remove notifications
    without breaking existing formatters. (Jon Rowe)
  • Change arguments passed to formatters. Rather than passing multiple
    arguments (which limits are ability to add additional arguments as
    doing so would break existing formatters), we now pass a notification
    value object that exposes the same data via attributes. This will
    allow us to add new bits of data to a notification event without
    breaking existing formattesr. (Jon Rowe)
  • Remove support for deprecated :alias option for
    RSpec.configuration.add_setting. (Myron Marston)
  • Remove support for deprecated RSpec.configuration.requires = [...].
    (Myron Marston)
  • Remove support for deprecated --formatter CLI option. (Myron Marston)
  • Remove support for deprecated --configure CLI option. (Myron Marston)
  • Remove support for deprecated RSpec::Core::RakeTask#spec_opts=.
    (Myron Marston)
  • An example group level pending block or :pending metadata now executes
    the example and cause a failure if it passes, otherwise it will be pending if
    it fails. The old "never run" behaviour is still used for xexample, xit,
    and xspecify, or via a new skip method or :skip metadata option.
    (Xavier Shay)
  • After calling pending inside an example, the remainder of the example will
    now be run. If it passes a failure is raised, otherwise the example is marked
    pending. The old "never run" behaviour is provided a by a new skip method.
    (Xavier Shay)
  • Pending blocks inside an example have been removed as a feature with no
    direct replacement. Use skip or pending without a block. (Xavier Shay)
  • Pending statement is no longer allowed in before(:all) hooks. Use skip
    instead. (Xavier Shay)
  • Remove show_failures_in_pending_blocks configuration option. (Xavier Shay)
  • Remove support for specifying the documentation formatter using
    's', 'n', 'spec' or 'nested'. (Jon Rowe)

Enhancements:

  • Add is_expected for one-liners that read well with the
    expect-based syntax. is_expected is simply defined as
    expect(subject) and can be used in an expression like:
    it { is_expected.to read_well }. (Myron Marston)
  • Add example run time to JSON formatter output. (Karthik Kastury)
  • Add more suggested settings to the files generated by
    rspec --init. (Myron Marston)
  • Add config.alias_example_group_to, which can be used to define a
    new method that defines an example group with the provided metadata.
    (Michi Huber)
  • Add xdescribe and xcontext as shortcuts to make an example group
    pending. (Myron Marston)
  • Add fdescribe and fcontext as shortcuts to focus an example group.
    (Myron Marston)
  • Don't autorun specs via #at_exit by default. require 'rspec/autorun'
    is only needed when running specs via ruby, as it always has been.
    Running specs via rake or rspec are both unaffected. (Ben Hoskings)
  • Add expose_dsl_globally config option, defaulting to true. When disabled
    it will remove the monkey patches rspec-core adds to main and Module
    (e.g. describe, shared_examples_for, etc). (Jon Rowe)
  • Expose RSpec DSL entry point methods (describe,
    shared_examples_for, etc) on the RSpec constant. Intended for use
    when expose_dsl_globally is set to false. (Jon Rowe)
  • For consistency, expose all example group aliases (including
    context) on the RSpec constant. If expose_dsl_globally is set to
    true, also expose them on main and Module. Historically, only describe
    was exposed. (Jon Rowe, Michi Huber)

Bug Fixes:

  • Fix failure (undefined method path) in end-of-run summary
    when raise_errors_for_deprecations! is configured. (Myron Marston)
  • Issue error when attempting to use -i or --I on command line,
    too close to -I to be considered short hand for --init. (Jon Rowe)
  • Prevent adding formatters to an output target if the same
    formatter has already been added to that output. (Alex Peattie)
  • Allow a matcher-generated example description to be used when
    the example is pending. (Myron Marston)
  • Ensure the configured failure_exit_code is used by the rake
    task when there is a failure. (Jon Rowe)
  • Restore behaviour whereby system exclusion filters take priority over working
    directory (was broken in beta1). (Jon Rowe)
  • Prevent RSpec mangling file names that have substrings containing line_number
    or default_path. (Matijs van Zuijlen)