Releases: rspec/rspec-core
Releases · rspec/rspec-core
2.14.8
2.14.8 / 2014-02-27
Bug fixes:
- Fix regression with the
TextMateFormatter
that prevented backtrace links
from being clickable. (Stefan Daschek)
3.0.0.beta2
3.0.0.beta2 / 2014-02-17
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,
usemock_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)
wherenotifications
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 forxexample
,xit
,
andxspecify
, or via a newskip
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 newskip
method.
(Xavier Shay) - Pending blocks inside an example have been removed as a feature with no
direct replacement. Useskip
orpending
without a block. (Xavier Shay) - Pending statement is no longer allowed in
before(:all)
hooks. Useskip
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
andxcontext
as shortcuts to make an example group
pending. (Myron Marston) - Add
fdescribe
andfcontext
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 viaruby
, as it always has been.
Running specs viarake
orrspec
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 tomain
andModule
(e.g.describe
,shared_examples_for
, etc). (Jon Rowe) - Expose RSpec DSL entry point methods (
describe
,
shared_examples_for
, etc) on theRSpec
constant. Intended for use
whenexpose_dsl_globally
is set tofalse
. (Jon Rowe) - For consistency, expose all example group aliases (including
context
) on theRSpec
constant. Ifexpose_dsl_globally
is set to
true
, also expose them onmain
andModule
. Historically, onlydescribe
was exposed. (Jon Rowe, Michi Huber)
Bug Fixes:
- Fix failure (undefined method
path
) in end-of-run summary
whenraise_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
ordefault_path
. (Matijs van Zuijlen)
2.99.0.beta2
2.99.0.beta2 / 2014-02-17
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) - Backport
skip
from RSpec 3, which acts likepending
did in RSpec 2
when not given a block, since the behavior ofpending
is changing in
RSpec 3. (Xavier Shay)
Deprecations:
- Deprecate inexact
mock_with
config options. RSpec 3 will only support
the exact symbols:rspec
,:mocha
,:flexmock
,:rr
or:nothing
(or any module that implements the adapter interface). RSpec 2 did
fuzzy matching but this will not be supported going forward.
(Myron Marston) - Deprecate
show_failures_in_pending_blocks
config option. To achieve
the same behavior as the option enabled, you can use a custom
formatter instead. (Xavier Shay) - Add a deprecation warning for the fact that the behavior of
pending
is changing in RSpec 3 -- rather than skipping the example (as it did
in 2.x when no block was provided), it will run the example and mark
it as failed if no exception is raised. Useskip
instead to preserve
the old behavior. (Xavier Shay) - Deprecate 's', 'n', 'spec' and 'nested' as aliases for documentation
formatter. (Jon Rowe) - Deprecate
RSpec::Core::Reporter#abort
in favor of
RSpec::Core::Reporter#finish
. (Jon Rowe)
Bug Fixes:
- Fix failure (undefined method
path
) in end-of-run summary
whenraise_errors_for_deprecations!
is configured. (Myron Marston) - Fix issue were overridding spec ordering from the command line wasn't
fully recognised interally. (Jon Rowe)
3.0.0.beta1
3.0.0.beta1 / 2013-11-07
Breaking Changes for 3.0.0:
- Remove explicit support for 1.8.6. (Jon Rowe)
- Remove
RSpec::Core::ExampleGroup#example
and
RSpec::Core::ExampleGroup#running_example
methods. If you need
access to the example (e.g. to get its metadata), use a block arg
instead. (David Chelimsky) - Remove
TextMateFormatter
, it has been moved torspec-tmbundle
.
(Aaron Kromer) - Remove RCov integration. (Jon Rowe)
- Remove deprecated support for RSpec 1 constructs (Myron Marston):
- The
Spec
andRspec
constants (rather thanRSpec
). Spec::Runner.configure
rather thanRSpec.configure
.Rake::SpecTask
rather thanRSpec::Core::RakeTask
.
- The
- Remove deprecated support for
share_as
. (Myron Marston) - Remove
--debug
option (and corresponding option on
RSpec::Core::Configuration
). Instead, use-r<debugger gem name>
to
load whichever debugger gem you wish to use (e.g.ruby-debug
,
debugger
, orpry
). (Myron Marston) - Extract Autotest support to a seperate gem. (Jon Rowe)
- Raise an error when a
let
orsubject
declaration is
accessed in abefore(:all)
orafter(:all)
hook. (Myron Marston) - Extract
its
support to a separate gem. (Peter Alfvin) - Disallow use of a shared example group from sibling contexts, making them
fully isolated. 2.14 and 2.99 allowed this but printed a deprecation warning.
(Jon Rowe) - Remove
RSpec::Core::Configuration#output
and
RSpec::Core::Configuration#out
aliases of
RSpec::Core::Configuration#output_stream
. (Myron Marston)
Enhancements
- Replace unmaintained syntax gem with coderay gem. (Xavier Shay)
- Times in profile output are now bold instead of
failure_color
.
(Matthew Boedicker) - Add
--no-fail-fast
command line option. (Gonzalo Rodríguez-Baltanás Díaz) - Runner now considers the local system ip address when running under Drb.
(Adrian CB) - JsonFormatter now includes
--profile
information. (Alex / @MasterLambaster) - Always treat symbols passed as metadata args as hash
keys with true values. RSpec 2 supported this with the
treat_symbols_as_metadata_keys_with_true_values
but
now this behavior is always enabled. (Myron Marston) - Add
--dry-run
option, which prints the formatter output
of your suite without running any examples or hooks.
(Thomas Stratmann, Myron Marston) - Document the configuration options and default values in the
spec_helper.rb
file that is generated by RSpec. (Parker Selbert) - Give generated example group classes a friendly name derived
from the docstring, rather than something like "Nested_2".
(Myron Marston) - Avoid affecting randomization of user code when shuffling
examples so that users can count on their own seeds
working. (Travis Herrick)
Deprecations
treat_symbols_as_metadata_keys_with_true_values
is deprecated and no
longer has an affect now that the behavior it enabled is always
enabled. (Myron Marston)
2.99.0.beta1
2.99.0.beta1 / 2013-11-07
Enhancements
- Block-based DSL methods that run in the context of an example
(it
,before(:each)
,after(:each)
,let
andsubject
)
now yield the example as a block argument. (David Chelimsky) - Warn when the name of more than one example group is submitted to
include_examples
and it's aliases. (David Chelimsky) - Add
expose_current_running_example_as
config option for
use during the upgrade process when external gems use the
deprecatedRSpec::Core::ExampleGroup#example
and
RSpec::Core::ExampleGroup#running_example
methods. (Myron Marston) - Limit spamminess of deprecation messages. (Bradley Schaefer, Loren Segal)
- Add
config.raise_errors_for_deprecations!
option, which turns
deprecations warnings into errors to surface the full backtrace
of the call site. (Myron Marston)
Deprecations
- Deprecate
RSpec::Core::ExampleGroup#example
and
RSpec::Core::ExampleGroup#running_example
methods. If you need
access to the example (e.g. to get its metadata), use a block argument
instead. (David Chelimsky) - Deprecate use of
autotest/rspec2
in favour ofrspec-autotest
. (Jon Rowe) - Deprecate RSpec's built-in debugger support. Use a CLI option like
-rruby-debug
(for the ruby-debug gem) or-rdebugger
(for the
debugger gem) instead. (Myron Marston) - Deprecate
RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values = false
.
RSpec 3 will not support having this option set tofalse
. (Myron Marston) - Deprecate accessing a
let
orsubject
declaration in
aafter(:all)
hook. (Myron Marston, Jon Rowe) - Deprecate built-in
its
usage in favor ofrspec-its
gem due to planned
removal in RSpec 3. (Peter Alfvin) - Deprecate
RSpec::Core::PendingExampleFixedError
in favor of
RSpec::Core::Pending::PendingExampleFixedError
. (Myron Marston) - Deprecate
RSpec::Core::Configuration#out
and
RSpec::Core::Configuration#output
in favor of
RSpec::Core::Configuration#output_stream
. (Myron Marston) - Deprecate legacy ordering APIs.
- You should use
register_ordering(:global)
instead of these:RSpec::Core::Configuration#order_examples
RSpec::Core::Configuration#order_groups
RSpec::Core::Configuration#order_groups_and_examples
- These are deprecated with no replacement because in RSpec 3
ordering is a property of individual example groups rather than
just a global property of the entire test suite:RSpec::Core::Configuration#order
RSpec::Core::Configuration#randomize?
--order default
is deprecated in favor of--order defined
(Myron Marston)
- You should use
2.14.7
2.14.7 / 2013-10-29
Bug fixes:
- Fix regression in 2.14.6 that broke the Fivemat formatter.
It depended upon either
example.execution_result[:exception].pending_fixed?
(which
was removed in 2.14.6 to fix an issue with frozen error objects)
orRSpec::Core::PendingExampleFixedError
(which was renamed
toRSpec::Core::Pending::PendingExampleFixedError
in 2.8.
This fix makes a constant alias for the old error name.
(Myron Marston)
2.14.6
2.14.6 / 2013-10-15
Bug fixes:
- Format stringified numbers correctly when mathn library is loaded.
(Jay Hayes) - Fix an issue that prevented the use of frozen error objects. (Lars
Gierth)
2.14.5
2.14.5 / 2013-08-13
Bug fixes:
- Fix a
NoMethodError
that was being raised when there were no shared
examples or contexts declared andRSpec.world.reset
is invoked.
(thepoho, Jon Rowe, Myron Marston) - Fix a deprecation warning that was being incorrectly displayed when
shared_examples
are declared at top level in amodule
scope.
(Jon Rowe) - Fix after(:all) hooks so consecutive (same context) scopes will run even if
one raises an error. (Jon Rowe, Trejkaz) - JsonFormatter no longer dies if
dump_profile
isn't defined (Alex / @MasterLambaster, Jon Rowe)
2.14.4
2.14.4 / 2013-07-21
Bug fixes
- Fix regression in 2.14: ensure configured requires (via
-r
option)
are loaded before spec files are loaded. This allows the spec files
to programatically change the file pattern (Jon Rowe). - Autoload
RSpec::Mocks
andRSpec::Expectations
when referenced if
they are not already loaded (RSpec::Matches
has been autoloaded
for a while). In therspec
gem, we changed it recently to stop
loadingrspec/mocks
andrspec/expectations
by default, as some
users reported problems where they were intending to use mocha,
not rspec-mocks, but rspec-mocks was loaded and causing a conflict.
rspec-core loads mocks and expectations at the appropriate time, so
it seemed like a safe change -- but caused a problem for some authors
of libraries that integrate with RSpec. This fixes that problem.
(Myron Marston) - Gracefully handle a command like
rspec --profile path/to/spec.rb
:
thepath/to/spec.rb
arg was being wrongly treated as theprofile
integer arg, which got cast0
usingto_i
, causing no profiled
examples to be printed. (Jon Rowe)
2.14.3
2.14.3 / 2013-07-13
Bug fixes
- Fix deprecation notices issued from
RSpec::Core::RakeTask
so
that they work properly when all of rspec-core is not loaded.
(This was a regression in 2.14) (Jon Rowe)