rspec-core/Changelog.md
Breaking Changes:
should syntax (including the non-monkey-patching one liner).
(Phil Pirozhkov, rspec/rspec-core#2803)run_all_when_everything_filtered configuration option. (Phil Pirozhkov, rspec/rspec-core#2845)shared_context_metadata_behavior to apply_to_host_groups
and remove the configuration option. (Phil Pirozhkov, rspec/rspec-core#2834)fail_fast is configured with
an unsupported value. (Phil Pirozhkov, rspec/rspec-core#2849):if/:unless filtering metadata. (Phil Pirozhkov, rspec/rspec-core#2870)color configuration option and --color command line
option. (Phil Pirozhkov, rspec/rspec-core#2864)it_should_behave_like nested shared group method and
alias_it_should_behave_like_to configuration option. (Phil Pirozhkov, rspec/rspec-core#2864)treat_symbols_as_metadata_keys_with_true_values configuration
option. (Phil Pirozhkov, rspec/rspec-core#2864)PendingExampleFixedNotification and
PendingExampleFailedAsExpectedNotification classes. (Phil Pirozhkov, rspec/rspec-core#2864)rerun_argument example method. (Phil Pirozhkov, rspec/rspec-core#2864)rspec-legacy_formatters.
(Phil Pirozhkov, rspec/rspec-core#2864):deprecations_only. (Jon Rowe, rspec/rspec#161)include_examples. (Phil Pirozhkov, rspec/rspec#259)Enhancements:
RSpec::Core::Configuration#force_line_number_for_spec_rerun) to
always print a line number rather than an example id when the line number is ambiguous.
(Baden Ashford, rspec/rspec-core#3085)RSpec::Core::Configuration#warnings= to take :all, :deprecations_only and :none
options. (Jean Boussier, rspec/rspec#161)Bug Fixes:
RSpec::World::Null.traverse_example_group_trees_until to
prevent warning. (@viralpraxis, rspec/rspec#240)Bug Fixes:
Bug Fixes:
Bug fixes:
ExamplesNotification used in RSpec::Core::Reporter#finish
by reusing an instance across notifcations. (Maxime Lapointe, rspec/rspec#172)RSpec::Core::Example#location_rerun_argument.
(Maxime Lapointe, rspec/rspec#173)Bug fixes:
RSpec::Configuration#requires will reflect files already required, whilst requiring
them. (Jon Rowe, rspec/rspec-core#3117)Bug fixes:
--bisect. (Maki Kawahara, rspec/rspec-core#3093)Enhancements:
--backtrace flag when using the JSON formatter. (Matt Larraz, rspec/rspec-core#2980).rspec). (Junichi Ito, rspec/rspec-core#2984)pending_failure_output config option to allow skipping backtraces or
muting pending specs output. (Phil Pirozhkov, rspec/rspec-core#2957)--dry-run before configuration flags that read files so that introspecting
it returns the correct value. (Xenor Chang, rspec/rspec-core#3008)--order. (Jon Rowe, rspec/rspec-core#3025)syntax_suggest output for SyntaxError when available.
(Richard Schneeman, rspec/rspec-core#3015, rspec/rspec-core#3026)RSpec::Core::Configuration#full_cause_backtrace) to print the
entire backtrace of an exception cause. (David Taylor, rspec/rspec-core#3046)Bug fixes:
__send__ in output wrapper to avoid issues with IO objects that implement send
like Socket. (Richard Platel, rspec/rspec-core#3045)Bug fixes:
Bug fixes:
extra_failure_lines from adding additional whitespace
around them when the lines already contain whitespace. (Jon Rowe, rspec/rspec-core#3006)Enhancements:
s (like process). (Joshua Pinter, rspec/rspec-core#2779)to_s to reserved names for #let and #subject. (Nick Flückiger, rspec/rspec-core#2886)RSpec.current_scope to expose the current scope in which
RSpec is executing. e.g. :before_example_hook, :example etc. (@odinhb, rspec/rspec-core#2895)SystemExit occurs. (Jared Beck, rspec/rspec-core#2926)Bug fixes:
inspect output of RSpec::Core::Example::Procsy to namespace correctly.
(Keiko Kaneko, rspec/rspec-core#2915)#output will not crash duplicate check.
(@niceking, rspec/rspec-core#2916)Bug fixes:
Enhancements:
RSpec::Core::Formatters::ExceptionPresenter#exception_lines to improve performance
with slow exception messages. (Maxime Lapointe, rspec/rspec-core#2743)Bug Fixes:
ruby2_keywords on method_missing for other gems. (Jon Rowe, rspec/rspec-core#2731)RSpec::Core::Configuration predicate config methods return booleans.
(Marc-André Lafortune, rspec/rspec-core#2736)rspec --bisect from generating zombie processes while executing
bisect runs. (Benoit Tigeot, Jon Rowe, rspec/rspec-core#2739)RSpec::Core::Example, #pending?, #skipped? and
#pending_fixed?) now return boolean values rather than truthy values.
(Marc-André Lafortune, rspec/rspec-core#2756, rspec/rspec-core#2758)Bug Fixes:
around hook is used with :context scope
(Phil Pirozhkov, rspec/rspec-core#2687)Exception#cause from being treated as a
valid cause (and causing strange errors) in RSpec::Core::Formatters::ExceptionPresenter.
(Jon Rowe, rspec/rspec-core#2703)rspec_opts is an array in RSpec::Core::RakeTask.
(Marc-André Lafortune, rspec/rspec-core#2704)RSpec.clear_examples reset example counts for example groups. This fixes
an issue with re-running specs not matching ids. (Agis Anastasopoulos, rspec/rspec-core#2723)Bug Fixes:
Enhancements:
did_you_mean suggestions for file names encountering a LoadError
outside of examples. (@obromios, rspec/rspec-core#2601)file:line:message. (Romain Tartière, rspec/rspec-core#2614)RSpec::Configuration#fail_fast
(Viktor Fonic, rspec/rspec-core#2634)RSpec::Configuration#fail_fast
(Viktor Fonic, rspec/rspec-core#2634)Bug Fixes:
config.define_derived_metadata so that cascades are not triggered
until metadata has been assigned to the example or example group
(Myron Marston, rspec/rspec-core#2635).Bug Fixes:
let methods that overwrite an existing method, prevent
a warning being issued by removing the old definition. (Jon Rowe, rspec/rspec-core#2593)config.define_derived_metadata so that it supports cascades.
(Myron Marston, rspec/rspec-core#2630).Enhancements:
RSpec::Core::RakeTask and --bisect so
that it works on Pathname objects. (Andrew Vit, rspec/rspec-core#2479)--require option. (Myron Marston, rspec/rspec-core#2504)--bisect on platforms that
support forking by replacing the shell-based runner with one that uses
forking so that RSpec and the application environment can be booted only
once, instead of once per spec run. (Myron Marston, rspec/rspec-core#2511)--bisect. Pick a runner via config.bisect_runner = :shell or
config.bisect_runner = :fork in a file loaded by a --require
option passed at the command line or set in .rspec. (Myron Marston, rspec/rspec-core#2511)~/.rspec is still supported when no
options file is found in $XDG_CONFIG_HOME/rspec/options (Magnus Bergmark, rspec/rspec-core#2538)RSpec.world.prepare_example_filtering that sets up the
example filtering for custom RSpec runners. (Oleg Pudeyev, rspec/rspec-core#2552)Bug Fixes:
ArgumentError when truncating backtraces with two identical
backtraces. (Systho, rspec/rspec-core#2515, Benoit Tigeot, rspec/rspec-core#2539)Bug Fixes:
Enhancements:
-n alias for --next-failure. (Ian Ker-Seymer, rspec/rspec-core#2434)--enable-frozen-string-literal option
on Ruby 2.3+. (Pat Allan, rspec/rspec-core#2425, rspec/rspec-core#2427, rspec/rspec-core#2437):context hooks for example groups that have been skipped.
(Devon Estes, rspec/rspec-core#2442)errors_outside_of_examples_count to the JSON formatter.
(Takeshi Arabiki, rspec/rspec-core#2448)Bug Fixes:
Enhancements:
config.output_stream after formatters have been
setup. (rspec/rspec-core#2401, rspec/rspec-core#2419, Ilya Lavrov)Bug Fixes:
RSpec.clear_examples resets the formatter and no longer clears
shared examples, and streams can be used across multiple runs rather than
being closed after the first. (rspec/rspec-core#2368, Xavier Shay)example_group_finished notifications causing an error.
(rspec/rspec-core#2396, VTJamie)config.when_first_matching_example_defined hooks would fire
multiple times in some cases. (Yuji Nakayama, rspec/rspec-core#2400)last_run_status to "unknown" when the status field in the
persistence file contains an unrecognized value. (rspec/rspec-core#2360, matrinox)let from defining an initialize method. (rspec/rspec-core#2414, Jon Rowe)Enhancements:
expect. (rspec/rspec-core#2358, Myron Marston)Enhancements:
_spec.rb) (rspec/rspec-core#2278, Devon Estes)=== instead of treating regular expressions as
special. (Myron Marston, rspec/rspec-core#2294)rspec -v so that it prints out the versions of each part of
RSpec to prevent confusion. (Myron Marston, rspec/rspec-core#2304)config.fail_if_no_examples option which causes RSpec to fail if
no examples are found. (Ewa Czechowska, rspec/rspec-core#2302)--force-color), even
if the output is not a TTY. --no-color continues to work as well.config.color_mode for configuring the color from Ruby.
:automatic is the default and will produce color if the output is
a TTY. :on forces it on and :off forces it off.Bug Fixes:
ExampleGroup constants when reseting RSpec,
preventing a memory leak. (TravisSpangle, rspec/rspec-core#2328)Bug Fixes:
:suite hooks and provide the same nicely formatted
output as errors that happen in examples. (Myron Marston, rspec/rspec-core#2316)after(:context) hook. (Myron Marston, rspec/rspec-core#2320)Bug Fixes:
example_finished until the example's execution_result
has been completely filled in. (Myron Marston, rspec/rspec-core#2291)duplicate_with
to clone examples. (bootstraponline, rspec/rspec-core#2298)--pattern in the Rake task when
rspec_opts specifies its own. (Jon Rowe, rspec/rspec-core#2305)Bug Fixes:
Enhancements:
SPEC_OPTS in reproduction command printed at the end of
a bisect run. (Simon Coffey, rspec/rspec-core#2274)Bug Fixes:
--bisect in SPEC_OPTS environment variable correctly so as
to avoid infinite recursion. (Simon Coffey, rspec/rspec-core#2271)Enhancements:
bundle exec. (Myron Marston, rspec/rspec-core#2240)rspec spec/unit spec/acceptance --order defined will run unit specs before acceptance
specs. (Myron Marston, rspec/rspec-core#2253)config.include_context API for configuring global or
filtered inclusion of shared contexts in example groups.
(Myron Marston, rspec/rspec-core#2256)config.shared_context_metadata_behavior = :apply_to_host_groups
option, which causes shared context metadata to be inherited by the
metadata hash of all host groups and examples instead of configuring
implicit auto-inclusion based on the passed metadata. (Myron Marston, rspec/rspec-core#2256)Bug Fixes:
--bisect so it works on large spec suites that were previously triggering
"Argument list too long errors" due to all the spec locations being passed as
CLI args. (Matt Jones, rspec/rspec-core#2223).:example_group-based filtering so that it properly
applies to matching example groups. (Myron Marston, rspec/rspec-core#2234)NoMethodError caused by Java backtraces on JRuby. (Michele Piccirillo, rspec/rspec-core#2244)Enhancements:
config.filter_run_when_matching API, intended to replace
the combination of config.filter_run and
config.run_all_when_everything_filtered (Myron Marston, rspec/rspec-core#2206)Bug Fixes:
def-end snippets
ending with end-only line can be extracted properly.
(Yuji Nakayama, rspec/rspec-core#2215)Enhancements:
:execution_result example group metadata, saving a
bit of memory. (Myron Marston, rspec/rspec-core#2172)config to previously defined groups.
(Myron Marston, rspec/rspec-core#2189)RSpec::Core::Configuration#reporter is now public API under SemVer.
(Jon Rowe, rspec/rspec-core#2193)config.when_first_matching_example_defined hook. (Myron
Marston, rspec/rspec-core#2175)Enhancements:
RSpec::Core::ExampleGroup.currently_executing_a_context_hook?,
primarily for use by rspec-rails. (Sam Phippen, rspec/rspec-core#2131)Bug Fixes:
MultipleExceptionError does not contain a recursive reference
to itself. (Sam Phippen, rspec/rspec-core#2133)Bug Fixes:
RSpec::Core::RakeTask so that it works with Rake 11.
(Travis Grathwell, rspec/rspec-core#2197)Bug Fixes:
TypeError from occurring when running via the rake task when
Ruby crashes. (Patrik Wenger, rspec/rspec-core#2161)do-end style
block and end with end-only line can be extracted properly.
(Yuji Nakayama, rspec/rspec-core#2173)Bug Fixes:
rspec --profile when an example calls abort or exit.
(Bradley Schaefer, rspec/rspec-core#2144)--drb so that when no DRb server is running, it prevents
the DRb connection error from being listed as the cause of all
expectation failures. (Myron Marston, rspec/rspec-core#2156)coderay gem is
installed as a rubygem but not already available on your load path
(as happens when you use bundler). (Myron Marston, rspec/rspec-core#2159)Bug Fixes:
nil.
(Myron Marston, rspec/rspec-core#2118)Enhancements:
--pattern arguments making them equivalent to
--pattern=1,2,...,n. (Jon Rowe, rspec/rspec-core#2002)inspect and to_s output for RSpec::Core::Example
objects, replacing Ruby's excessively verbose output. (Gavin Miller, rspec/rspec-core#1922)silence_filter_announcements configuration option.
(David Raffensperger, rspec/rspec-core#2007)example_finished notification to the reporter protocol for
when you don't care about the example outcome. (Jon Rowe, rspec/rspec-core#2013)--bisect to a recursion-based bisection algorithm rather than
a permutation-based one. This better handles cases where an example
depends upon multiple other examples instead of just one and minimizes
the number of runs necessary to determine that an example set cannot be
minimized further. (Simon Coffey, rspec/rspec-core#1997):symbol key only) to be triggered by truthey
values. (Tim Mertens, rspec/rspec-core#2035)ansicon on Windows when using
RSpec's --color option. (Ashley Engelund, rspec/rspec-core#2038)cause of a failure or error to the printed failure
output when a cause is available. (Adam Magan)NoMemoryError, SignalExcepetion, Interrupt and
SystemExit. It is dangerous to interfere with these. (Myron Marston, rspec/rspec-core#2063)config.project_source_dirs setting which RSpec uses to determine
if a backtrace line comes from your project source or from some
external library. It defaults to spec, lib and app but can be
configured differently. (Myron Marston, rspec/rspec-core#2088):extra_failure_lines example metadata that will
be appended to the failure output. (bootstraponline, rspec/rspec-core#2092).RSpec::Core::Example#duplicate_with to produce new examples
with cloned metadata. (bootstraponline, rspec/rspec-core#2098)RSpec::Core::Configuration#on_example_group_definition to register
hooks to be invoked when example groups are created. (bootstraponline, rspec/rspec-core#2094)add_example and remove_example to RSpec::Core::ExampleGroup to
allow manipulating an example groups examples. (bootstraponline, rspec/rspec-core#2095)max_displayed_failure_line_count configuration option
(defaults to 10). (Yuji Nakayama, rspec/rspec-core#2083)fail_fast option so it can take a number (e.g. --fail-fast=3)
to force the run to abort after the specified number of failures.
(Jack Scotti, rspec/rspec-core#2065)color
is enabled and the coderay gem is installed on a POSIX system.
(Myron Marston, rspec/rspec-core#2109)Bug Fixes:
example_status_persistence_file when reading from and writing
to it to prevent race conditions when multiple processes try to use
it. (Ben Woosley, rspec/rspec-core#2029)1[]_spec.rb) to not be loaded properly. (Myron Marston, rspec/rspec-core#2041)rspec/core/rake_task.rb to avoid double requires
seen by some users. (Myron Marston, rspec/rspec-core#2101)Bug Fixes:
backtrace returns nil.
(Myron Marston, rspec/rspec-core#2023)Bug Fixes:
before(:suite) (and friends) in the context of an example
group instance, thus making the expected RSpec environment available.
(Jon Rowe, rspec/rspec-core#1986)Enhancements:
RSpec::Core::Example#reporter.
(Jon Rowe, rspec/rspec-core#1866)RSpec::Core::Reporter#message a public supported API. (Jon Rowe, rspec/rspec-core#1866)RSpec::Core::Reporter#publish(event_name, hash_of_attributes). (Jon Rowe, rspec/rspec-core#1869)Set and replace with RSpec::Core::Set.
(Jon Rowe, rspec/rspec-core#1870)config.example_status_persistence_file_path option, which is
used to persist the last run status of each example. (Myron Marston, rspec/rspec-core#1888):last_run_status metadata to each example, which indicates what
happened the last time an example ran. (Myron Marston, rspec/rspec-core#1888)--only-failures CLI option which filters to only the examples
that failed the last time they ran. (Myron Marston, rspec/rspec-core#1888)--next-failure CLI option which allows you to repeatedly focus
on just one of the currently failing examples, then move on to the
next failure, etc. (Myron Marston, rspec/rspec-core#1888)--order random ordering stable, so that when you rerun a
subset with a given seed, the examples will be order consistently
relative to each other. (Myron Marston, rspec/rspec-core#1908)let and subject threadsafe. (Josh Cheek, rspec/rspec-core#1858)--bisect CLI option, which will repeatedly run your suite in
order to isolate the failures to the smallest reproducible case.
(Myron Marston, rspec/rspec-core#1917)config.include, config.extend and config.prepend, apply the
module to previously defined matching example groups. (Eugene Kenny, rspec/rspec-core#1935).rspec or ~/.rspec or ENV['SPEC_OPTS']) so they can
easily find the source of the problem. (Myron Marston, rspec/rspec-core#1940):aggregate_failures metadata. Tag an example or
group with this metadata and it'll use rspec-expectations'
aggregate_failures feature to allow multiple failures in an example
and list them all, rather than aborting on the first failure. (Myron
Marston, rspec/rspec-core#1946)before(:context)
hooks. (Denis Laliberté, Jon Rowe, rspec/rspec-core#1971)it block and one from an after block. (Myron Marston, rspec/rspec-core#1985)Bug Fixes:
RSpec::Core::RakeTask#failure_message so that it gets printed
when the task failed. (Myron Marston, rspec/rspec-core#1905)let work properly when defined in a shared context that is applied
to an individual example via metadata. (Myron Marston, rspec/rspec-core#1912)rspec/autorun respects configuration defaults. (Jon Rowe, rspec/rspec-core#1933)Bug Fixes:
Kernel (such as
the its-it gem). (Alex Kwiatkowski, Ryan Ong, rspec/rspec-core#1907)before(:context) { skip } so that it does not wrongly cause the
spec suite to exit with a non-zero status when no examples failed.
(Myron Marston, rspec/rspec-core#1926)Bug Fixes:
Bug Fixes:
start notification rather than
after so that formatters like Fuubar work properly. (Samuel Esposito, rspec/rspec-core#1882)Enhancements:
inspect output of example groups. (Mike Dalton, rspec/rspec-core#1687)verbose flag is
set. (Ben Snape, rspec/rspec-core#1704)RSpec.clear_examples as a clear way to reset examples in between
spec runs, whilst retaining user configuration. (Alexey Fedorov, rspec/rspec-core#1706):suite hooks are registered on an example group
(where it has always been ignored) or are registered with metadata
(which has always been ignored). (Myron Marston, rspec/rspec-core#1805)context, describe, it, let, before, etc) from
within an example where those APIs are unavailable. (Myron Marston, rspec/rspec-core#1819)expect, double, stub_const, etc) from
within an example group where those APIs are unavailable.
(Myron Marston, rspec/rspec-core#1819)RSpec::Core::Sandbox.sandboxed { } API that facilitates
testing RSpec with RSpec, allowing you to define example groups
and example from within an example without affecting the global
RSpec.world state. (Tyler Ball, 1808)-I option support multiple values when separated by
File::PATH_SEPARATOR, such as rspec -I foo:bar. This matches
the behavior of Ruby's -I option. (Fumiaki Matsushima, rspec/rspec-core#1855).RSpec.shared_context "Uses redis", :uses_redis will now apply
to individual examples tagged with :uses_redis, as will
config.include RedisHelpers, :uses_redis, and
config.before(:context, :uses_redis) { }, etc. (Myron Marston, rspec/rspec-core#1749)Bug Fixes:
matcher.description in the example description.
(Myron Marston, rspec/rspec-core#1771)after hooks when generating
example descriptions. (Myron Marston, rspec/rspec-core#1771)config.expect_with :minitest so that skip uses RSpec's
implementation rather than Minitest's. (Jonathan Rochkind, rspec/rspec-core#1822)NameError caused when duplicate example group aliases are defined and
the DSL is not globally exposed. (Aaron Kromer, rspec/rspec-core#1825)RSpec::Core::Example::ExecutionResult#pending_exception --
previously it was not being set but should have been. (Myron Marston, rspec/rspec-core#1844)rspec-core is installed in a directory
containing a space. (Guido Günther, rspec/rspec-core#1845)describe Regexp to raise errors.
(Durran Jordan, rspec/rspec-core#1853)--seed before loading --require files so that required files
can access the provided seed. (Myron Marston, rspec/rspec-core#1745)RSpec::Core::Formatters::DeprecationFormatter::FileStream being
reopened with an IO stream, which sometimes happens with spring.
(Kevin Mook, rspec/rspec-core#1757)Bug Fixes:
Metadata.relative_path so that for a current directory of
/foo/bar, /foo/bar_1 is not wrongly converted to ._1.
(Akos Vandra, rspec/rspec-core#1730)RSpec::ExampleGroups generated
constants on 1.9.2 by appending a trailing _ to the generated names.
(Jon Rowe, rspec/rspec-core#1737):pending metadata. If it got set in any way besides passing
it as part of the metadata literal passed to it (such as by using
define_derived_metadata), it did not have the desired effect,
instead marking the example as :passed. (Myron Marston, rspec/rspec-core#1739)Bug Fixes:
spec
from working properly. (Myron Marston, rspec/rspec-core#1734)Bug Fixes:
rake_task.pattern to an absolute path pattern in
RSpec 3.0 and before worked since it delegated to FileList internally
(but now just forwards the pattern on to the rspec command).
(Myron Marston, rspec/rspec-core#1726)Bug Fixes:
subject when using describe false or describe nil
so that it returns the provided primitive rather than the string
representation. (Myron Marston, rspec/rspec-core#1710)Bug Fixes:
task.pattern = FileList["..."] to work. That was never intended
to be supported but accidentally worked in 3.0 and earlier.
(Myron Marston, rspec/rspec-core#1701)--exclude-pattern matched files from the
--pattern matched files so that it still works even if the patterns
are in slightly different forms (e.g. one starting with ./).
(Christian Nelson, rspec/rspec-core#1698)Bug Fixes:
./ still work. (Christian Nelson, rspec/rspec-core#1696)Bug Fixes:
rake_task.pattern = array
works again. While we never intended to support array values (or even knew that worked!),
the implementation from 3.0 and earlier used FileList internally, which allows arrays.
The fix restores the old behavior. (Myron Marston, rspec/rspec-core#1694)Enhancements:
rspec --init so that warnings are enabled
in commented out section of spec_helper rather than .rspec so users
have to consciously opt-in to the setting. (Andrew Hooker, rspec/rspec-core#1572)spec_helper generated by rspec --init so that it sets the new
rspec-expectations include_chain_clauses_in_custom_matcher_descriptions
config option (which will be on by default in RSpec 4) and also sets the
rspec-mocks verify_partial_doubles option (which will also default
to on in RSpec 4). (Myron Marston, rspec/rspec-core#1647)inspect output for example procsy objects (used in around
hooks) that doesn't make them look like procs. (Jon Rowe, rspec/rspec-core#1620)require statements from
rspec/core/rake_task.rb, making it even more lighterweight.
(Myron Marston, rspec/rspec-core#1640)config.filter_gems_from_backtrace "rack", "rake" API
to easily filter the named gems from backtraces. (Myron Marston, rspec/rspec-core#1682):git dependency.
(Myron Marston, rspec/rspec-core#1648)-S. (Myron Marston, rspec/rspec-core#1559)--exclude-pattern CLI option, config.exclude_pattern = config
option and task.exclude_pattern = rake task config option. Matching
files will be excluded. (John Gesimondo, Myron Marston, rspec/rspec-core#1651, rspec/rspec-core#1671)FileUtils from the standard library so that users do
not get false positives where their code relies on it but they are not
requiring it. (Sam Phippen, rspec/rspec-core#1565)Bug Fixes:
t.pattern = option so that it does not run all specs
when it matches no files, by passing along a --pattern option to
the rspec command, rather than resolving the file list and passing
along the files individually. (Evgeny Zislis, rspec/rspec-core#1653)rspec command so that it follows
symlinks properly. (Myron Marston, rspec/rspec-core#1672)describe "Core". (Daniela Wellisz, rspec/rspec-core#1679)Bug Fixes:
config.files_to_run
is accessed from a file loaded by --require, --pattern is still
applied. (Myron Marston, rspec/rspec-core#1652)config.pattern= so that it still takes affect even if
config.files_to_run has already been accessed. (Myron Marston, rspec/rspec-core#1652)Bug Fixes:
::RSpec::Core::Notifications::FailedExampleNotification#message_lines
to be accessed without a colouriser. (@tomykaira, rspec/rspec-core#1637)Bug Fixes:
--tag slow
passed at the command line from overriding --tag ~slow in .rspec.
(Colin Jones, rspec/rspec-core#1602):example_group deprecation warning so that it gets
issued at the call site of the configuration that specified it as
a filter rather than later when an example group is defined.
(Myron Marston, rspec/rspec-core#1562)Bug Fixes:
Config will no longer cause a Ruby warning to be
issued. (Jimmy Cuadra, rspec/rspec-core#1580)Bug Fixes:
BaseTextFormatter so that it does not re-close a closed output
stream. (Myron Marston):parent_example_group key even though it has
no parent example group. (Myron Marston)Enhancements:
spec_helper.rb to no longer recommend
config.full_backtrace = true see rspec/rspec-core#1536 for discussion. (Jon Rowe)Breaking Changes for 3.0.0:
described_class so that in a nested group like describe MyClass, it returns MyClass rather than the outer group's described
class. (Myron Marston)BaseTextFormatter. (Jon Rowe)BaseTextFormatter. (Jon Rowe):example_group subhash. In addition, the parent example
group metadata is now available as [:parent_example_group] rather
than [:example_group][:example_group]. Deprecated access via the
old key structure is still provided. (Myron Marston):describes metadata key. It duplicates :described_class
for no good reason. Deprecated access via :describes is still
provided. (Myron Marston):example_group_block metadata key to :block.
(Myron Marston)RSpec::Core::Example#options. (Myron Marston)BaseTextFormatter#colorize_summary to SummaryNotification#colorize_with
(Jon Rowe).describe some_hash treated some_hash as metadata in RSpec 2.x but
will treat it as the described object in RSpec 3.0. Metadata must
always come after the description args. (Myron Marston)display_name alias of ExampleGroup.description.
(Myron Marston)describes alias of ExampleGroup.described_class.
(Myron Marston)RSpec::Core::ExampleGroup.alias_it_behaves_like_to.
Use RSpec::Core::Configuration#alias_it_behaves_like_to instead.
(Myron Marston)RSpec::Core::ExampleGroup.alias_example_to.
Use RSpec::Core::Configuration#alias_example_to instead.
(Myron Marston)focused example alias and change example/group aliases
fit, focus, fcontext and fdescribe to no longer include
:focused => true metadata. They only contain :focus => true
metadata now. This means that you will need to filter them with
filter_run :focus, not filter_run :focused. (Myron Marston)--line-number filtering. It's semantically dubious since it's
a global filter (potentially applied to multiple files) but there's no
meaningful connection between the same line number in multiple files.
Instead use the rspec path/to/spec.rb:23:46 form, which is terser
and makes more sense as it is scoped to a file. (Myron Marston)--default_path as an alias for --default-path. (Jon Rowe)share_examples_for. There's still
shared_examples and shared_examples_for. (Myron Marston)RSpec::Core::Configuration#warnings to
RSpec::Core::Configuration#warnings? since it's a boolean flag.
(Myron Marston)RSpec::Core::CommandLine (never formally declared public)
into RSpec::Core::Runner. (Myron Marston)color_enabled as an alias of color. (Jon Rowe)backtrace_cleaner as an alias of backtrace_formatter. (Jon Rowe)filename_pattern as an alias of pattern. (Jon Rowe)rspec-legacy_formatters. (Jon Rowe)RSpec::Configuration#formatters now returns a dup to prevent mutation. (Jon Rowe)stdlib as an available expectation framework with test_unit and
minitest. (Aaron Kromer)BaseTextFormatter. (Jon Rowe)ProfileFormatter and ProfileNotification.
Formatters should implement dump_profile if they wish to respond to --profile.
(Jon Rowe)ExamplesNotification to share information about examples that was previously
held in BaseFormatter. (Jon Rowe)Enhancements:
config.default_formatter attribute, which can be used to set a
formatter which will only be used if no other formatter is set
(e.g. via --formatter). (Myron Marston)LegacyFormatterAdaptor. (Jon Rowe)execution_result (exposed by metadata) from a hash to a
first-class object with appropriate attributes. status is now
stored and returned as a symbol rather than a string. It retains
deprecated hash behavior for backwards compatibility. (Myron Marston):block metadata entry to the example metadata, bringing
parity with :block in the example group metadata. (Myron Marston)fspecify and fexample as aliases of specify and example
with :focus => true metadata for parity with fit. (Myron Marston)colorize_summary. (Jon Rowe)RSpec::Core::ConfigurationOptions as an officially
supported public API. (Myron Marston)--deprecation-out CLI option which directs deprecation warnings
to the named file. (Myron Marston)expect_with :stdlib (now available as
expect_with :minitest). (Xavier Shay)StartNotification and SummaryNotification. (Jon Rowe)disable_monkey_patching! config option that disables all monkey
patching from whatever pieces of RSpec you use. (Alexey Fedorov)Pathname support for setting all output streams. (Aaron Kromer)config.define_derived_metadata, which can be used to apply
additional metadata to all groups or examples that match a given
filter. (Myron Marston)FailedExampleNotification
and send PendingExampleFixedNotifications when the error is due to a
passing spec you expect to fail. (Jon Rowe)dump_profile to formatter API to allow formatters to implement
support for --profile. (Jon Rowe)ConsoleCodes with RSpec 'states'
(e.g. :success, :failure) rather than direct colour codes. (Jon Rowe)fully_formatted methods off the formatter notification objects
that make it easy for a custom formatter to produce formatted output
like rspec-core's. (Myron Marston)Bug Fixes:
spec_helper.rb file generated by rspec --init so that the
recommended settings correctly use the documentation formatter
when running one file. (Myron Marston)describe :foo). (Myron Marston)RSpec.describe) when
already inside a context. There is no reason to do this, and it could
potentially cause unexpected bugs. (Xavier Shay)--warnings option so that it enables warnings immediately so
that it applies to files loaded by --require. (Myron Marston)config.deprecation_stream too late for
it to take effect because the reporter has already been setup. (Myron Marston)RSpec::Core::Example interface to the argument yielded
to around hooks. (Myron Marston)rspec, even if a newer version is also
installed. (Postmodern)Breaking Changes for 3.0.0:
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):if and :unless
filters. (Ashish Dixit)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):alias option for
RSpec.configuration.add_setting. (Myron Marston)RSpec.configuration.requires = [...].
(Myron Marston)--formatter CLI option. (Myron Marston)--configure CLI option. (Myron Marston)RSpec::Core::RakeTask#spec_opts=.
(Myron Marston)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)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)skip or pending without a block. (Xavier Shay)before(:all) hooks. Use skip
instead. (Xavier Shay)show_failures_in_pending_blocks configuration option. (Xavier Shay)Enhancements:
rspec --init. (Myron Marston)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)xdescribe and xcontext as shortcuts to skip an example group.
(Myron Marston)fdescribe and fcontext as shortcuts to focus an example group.
(Myron Marston)#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)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)describe,
shared_examples_for, etc) on the RSpec constant. Intended for use
when expose_dsl_globally is set to false. (Jon Rowe)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):example as an alias for :each, and :context as an alias
for :all. (John Feminella)Bug Fixes:
path) in end-of-run summary
when raise_errors_for_deprecations! is configured. (Myron Marston)-i or --I on command line,
too close to -I to be considered short hand for --init. (Jon Rowe)failure_exit_code is used by the rake
task when there is a failure. (Jon Rowe)line_number
or default_path. (Matijs van Zuijlen)ruby using rspec/autorun).
(Myron Marston, rspec/rspec-core#1829)Breaking Changes for 3.0.0:
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)TextMateFormatter, it has been moved to rspec-tmbundle.
(Aaron Kromer)Spec and Rspec constants (rather than RSpec).Spec::Runner.configure rather than RSpec.configure.Rake::SpecTask rather than RSpec::Core::RakeTask.share_as. (Myron Marston)--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, or pry). (Myron Marston)let or subject declaration is
accessed in a before(:all) or after(:all) hook. (Myron Marston)its support to a separate gem. (Peter Alfvin)RSpec::Core::Configuration#output and
RSpec::Core::Configuration#out aliases of
RSpec::Core::Configuration#output_stream. (Myron Marston)Enhancements:
failure_color.
(Matthew Boedicker)--no-fail-fast command line option. (Gonzalo Rodríguez-Baltanás Díaz)--profile information. (Alex / @MasterLambaster)treat_symbols_as_metadata_keys_with_true_values but
now this behavior is always enabled. (Myron Marston)--dry-run option, which prints the formatter output
of your suite without running any examples or hooks.
(Thomas Stratmann, Myron Marston)spec_helper.rb
file that is generated by RSpec. (Parker Selbert):order metadata. (Andy
Lindeman, Sam Phippen, Myron Marston)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)Enhancements:
describe <a symbol>
behavior. (Jon Rowe, rspec/rspec-core#1667)Bug Fixes:
RSpec::Core::Runner is used
multiple times in the same process. In 2.x RSpec's global state was
automatically cleared between runs but in 3.0 you need to call RSpec.reset
manually in these situations. (Sam Phippen, rspec/rspec-core#1587)be_
matchers due to automatically generated descriptions. (Jon Rowe, rspec/rspec-core#1573)rspec/core when loading rspec/core/rake_task to ensure we can
issue deprecations correctly. (Jon Rowe, rspec/rspec-core#1612)Bug Fixes:
BaseTextFormatter so that it does not re-close a closed output
stream. (Myron Marston)RSpec::Configuration#backtrace_exclusion_patterns rather than the
deprecated RSpec::Configuration#backtrace_clean_patterns when mocking
with rr. (David Dollar)Enhancements:
--deprecation-out CLI option which directs deprecation warnings
to the named file. (Myron Marston)skip in metadata to skip execution of an example.
(Xavier Shay, rspec/rspec-core#1472)Pathname support for setting all output streams. (Aaron Kromer)test_unit and minitest expectation frameworks. (Aaron Kromer)Deprecations:
RSpec::Core::Pending::PendingDeclaredInExample, use
SkipDeclaredInExample instead. (Xavier Shay)described_class is accessed from within
a nested describe <SomeClass> example group, since described_class
will return the innermost described class in RSpec 3 rather than the
outermost described class, as it behaved in RSpec 2. (Myron Marston)RSpec::Core::FilterManager::DEFAULT_EXCLUSIONS,
RSpec::Core::FilterManager::STANDALONE_FILTERS and use of
#empty_without_conditional_filters? on those filters. (Sergey Pchelincev)RSpec::Core::Example#options in favor of
RSpec::Core::Example#metadata. (Myron Marston)describe or context
as the first argument. In RSpec 2.x this would be treated as metadata
but in RSpec 3 it'll be treated as the described object. To continue
having it treated as metadata, pass a description before the symbol or
hash. (Myron Marston)RSpec::Core::BaseTextFormatter::VT100_COLORS and
RSpec::Core::BaseTextFormatter::VT100_COLOR_CODES in favour
of RSpec::Core::BaseTextFormatter::ConsoleCodes::VT100_CODES and
RSpec::Core::BaseTextFormatter::ConsoleCodes::VT100_CODE_VALUES.
(Jon Rowe)RSpec::Core::ExampleGroup.display_name in favor of
RSpec::Core::ExampleGroup.description. (Myron Marston)RSpec::Core::ExampleGroup.describes in favor of
RSpec::Core::ExampleGroup.described_class. (Myron Marston)RSpec::Core::ExampleGroup.alias_example_to in favor of
RSpec::Core::Configuration#alias_example_to. (Myron Marston)RSpec::Core::ExampleGroup.alias_it_behaves_like_to in favor
of RSpec::Core::Configuration#alias_it_behaves_like_to. (Myron Marston)RSpec::Core::ExampleGroup.focused in favor of
RSpec::Core::ExampleGroup.focus. (Myron Marston)config.filter_run :focused since
example aliases fit and focus will no longer include
:focused metadata but will continue to include :focus. (Myron Marston):line_number (e.g. --line-number from the
CLI). Use location filtering instead. (Myron Marston)--default_path as an alternative to --default-path. (Jon Rowe)RSpec::Core::Configuration#warnings in favor of
RSpec::Core::Configuration#warnings?. (Myron Marston)share_examples_for in favor of shared_examples_for or
just shared_examples. (Myron Marston)RSpec::Core::CommandLine in favor of
RSpec::Core::Runner. (Myron Marston)#color_enabled, #color_enabled= and #color? in favour of
#color, #color= and #color_enabled? output. (Jon Rowe)#filename_pattern in favour of #pattern. (Jon Rowe)#backtrace_cleaner in favour of #backtrace_formatter. (Jon Rowe)RSpec::Configuration#formatters. (Jon Rowe)stdlib as an available expectation framework in favour of
test_unit and minitest. (Aaron Kromer)Bug Fixes:
config.deprecation_stream too late for
it to take effect because the reporter has already been setup. (Myron Marston)skip with a block should not execute the block. (Xavier Shay)Enhancements:
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)skip from RSpec 3, which acts like pending did in RSpec 2
when not given a block, since the behavior of pending is changing in
RSpec 3. (Xavier Shay)Deprecations:
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)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)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. Use skip instead to preserve
the old behavior. (Xavier Shay)RSpec::Core::Reporter#abort in favor of
RSpec::Core::Reporter#finish. (Jon Rowe)Bug Fixes:
path) in end-of-run summary
when raise_errors_for_deprecations! is configured. (Myron Marston)Enhancements
it, before(:each), after(:each), let and subject)
now yield the example as a block argument. (David Chelimsky)include_examples and it's aliases. (David Chelimsky)expose_current_running_example_as config option for
use during the upgrade process when external gems use the
deprecated RSpec::Core::ExampleGroup#example and
RSpec::Core::ExampleGroup#running_example methods. (Myron Marston)config.raise_errors_for_deprecations! option, which turns
deprecations warnings into errors to surface the full backtrace
of the call site. (Myron Marston)Deprecations
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)autotest/rspec2 in favour of rspec-autotest. (Jon Rowe)-rruby-debug (for the ruby-debug gem) or -rdebugger (for the
debugger gem) instead. (Myron Marston)RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values = false.
RSpec 3 will not support having this option set to false. (Myron Marston)let or subject declaration in
a after(:all) hook. (Myron Marston, Jon Rowe)its usage in favor of rspec-its gem due to planned
removal in RSpec 3. (Peter Alfvin)RSpec::Core::PendingExampleFixedError in favor of
RSpec::Core::Pending::PendingExampleFixedError. (Myron Marston)RSpec::Core::Configuration#out and
RSpec::Core::Configuration#output in favor of
RSpec::Core::Configuration#output_stream. (Myron Marston)register_ordering(:global) instead of these:
RSpec::Core::Configuration#order_examplesRSpec::Core::Configuration#order_groupsRSpec::Core::Configuration#order_groups_and_examplesRSpec::Core::Configuration#orderRSpec::Core::Configuration#randomize?--order default is deprecated in favor of --order defined
(Myron Marston)Bug fixes:
textmateformatter that prevented backtrace links
from being clickable. (Stefan Daschek)Bug fixes:
example.execution_result[:exception].pending_fixed? (which
was removed in 2.14.6 to fix an issue with frozen error objects)
or RSpec::Core::PendingExampleFixedError (which was renamed
to RSpec::Core::Pending::PendingExampleFixedError in 2.8.
This fix makes a constant alias for the old error name.
(Myron Marston)Bug fixes:
Bug fixes:
NoMethodError that was being raised when there were no shared
examples or contexts declared and RSpec.world.reset is invoked.
(thepoho, Jon Rowe, Myron Marston)shared_examples are declared at top level in a module scope.
(Jon Rowe)dump_profile isn't defined (Alex / @MasterLambaster, Jon Rowe)Bug fixes
-r option)
are loaded before spec files are loaded. This allows the spec files
to programatically change the file pattern (Jon Rowe).RSpec::Mocks and RSpec::Expectations when referenced if
they are not already loaded (RSpec::Matches has been autoloaded
for a while). In the rspec gem, we changed it recently to stop
loading rspec/mocks and rspec/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)rspec --profile path/to/spec.rb:
the path/to/spec.rb arg was being wrongly treated as the profile
integer arg, which got cast 0 using to_i, causing no profiled
examples to be printed. (Jon Rowe)Bug fixes
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)Bug fixes
respond_to? a notification, but had
no corresponding method would raise an error when registered.
The new fix is to just implement start on the deprecation
formatter to fix the original JRuby/ruby-debug issue.
(Jon Rowe)Bug fixes
ruby-debug on
JRuby: fix RSpec::Core::Reporter to not send a notification
when the formatter's implementation of the notification method
comes from Kernel (Alex Portnov, Jon Rowe).Enhancements
fit (equivalent of
it "description", focus: true) (Michael de Silva)Bug fix
let take precedence over others
when there is a name collision (e.g. from an included module).
(Jon Rowe, Andy Lindeman and Myron Marston)Enhancements
--color handling.--profile option.
The output is sorted by the slowest average example groups.--fail-fast
and --profile options are used (Paweł Gościcki).spec to the load path, add the configured
--default-path to the load path (which defaults to spec). This
better supports folks who choose to put their specs in a different
directory (John Feminella).backtrace_inclusion_patterns config option. Backtrace lines
that match one of these patterns will always be included in the
backtrace, even if they match an exclusion pattern, too (Sam Phippen).- when parsing .rspec as ERB
(Gabor Garami)..rspec-local in the configuration documentation
(Sam Phippen){a,b} shell expansion syntax in --pattern option
(Konstantin Haase).config.libs returns the libs configured to be added onto the load pathfull_backtrace? returns the state of the backtrace cleanerdebug? returns true when the debugger is loadedline_numbers returns the line numbers we are filtering by (if any)full_description returns the RegExp used to filter descriptions
(Jon Rowe)--warnings (Jon Rowe)1.8.7 where Time.dup wouldn't
allow access to Time.now (Jon Rowe)shared_examples_for context aware, so that keys may be safely reused
in multiple contexts without colliding. (Jon Rowe)deprecation_stream (Jon Rowe)Bug fixes
--profile as
the text formatter (Paweł Gościcki).subject still retains the originally
declared value (Myron Marston).rand in examples in
nested sibling contexts to return the same value (Max Shytikov).backtrace_inclusion_patterns config option to ensure
that folks who develop code in a directory matching one of the default
exclusion patterns (e.g. gems) still get the normal backtrace
filtering (Sam Phippen).before hooks so that before hooks declared in
RSpec.configure run before before hooks declared in a shared
context (Michi Huber and Tejas Dinkar).Example#full_description so that it gets filled in by the last
matcher description (as Example#description already did) when no
doc string has been provided (David Chelimsky).let and subject) leaking define_method
as a public method. (Thomas Holmes and Jon Rowe) (rspec/rspec-core#873)Deprecations
Configuration#backtrace_clean_patterns in favor of
Configuration#backtrace_exclusion_patterns for greater consistency
and symmetry with new backtrace_inclusion_patterns config option
(Sam Phippen).Configuration#requires= in favor of using ruby's
require. Requires specified by the command line can still be
accessed by the Configuration#require reader. (Bradley Schaefer)SharedExampleGroups defined across sibling contexts
(Jon Rowe)Bug fixes
super in a named subject (which is confusing,
anyway -- named subjects create 2 methods, so which method on the
parent example group are you supering to?) but super in an unnamed
subject continues to work (Myron Marston).let or subject in before(:all) to cause
other let declarations to leak across examples (Myron Marston).String#match that was triggered
by passing it a regex from a let declaration. For more info, see
http://bugs.ruby-lang.org/issues/8059 (Aaron Kromer).require 'set' to base_text_formatter.rb (Tom
Anderson).Deprecations
let or subject declarations in before(:all).
These were not intended to be called in a before(:all) hook, as
they exist to define state that is reset between each example, while
before(:all) exists to define state that is shared across examples
in an example group (Myron Marston).Enhancements
--profile option to take a count argument that
determines the number of slow examples to dump
(Greggory Rothmeier).subject! that is the analog to let!. It defines an
explicit subject and sets a before hook that will invoke
the subject (Zubin Henner).let and subject declaration so that super
and return can be used in them, just like in a normal
method. (Myron Marston)--profile option is given,
even when an example failed (Myron Marston).Bug fixes
its so that uses of subject in a before or let
declaration in the parent group continue to reference the
parent group's subject. (Olek Janiszewski)Bug fixes
RSpec::Core::RakeTask so that it is compatible with rake 0.8.7
on ruby 1.8.7. We had accidentally broke it in the 2.12 release
(Myron Marston).RSpec::Core::RakeTask so it is tolerant of the Rspec constant
for backwards compatibility (Patrick Van Stee)Bug fixes
exit. This allows
Test::Unit and RSpec to run together. (Suraj N. Kurapati)RSpec::Core::Formatters::BaseFormatter#format_backtrce(backtrace, example)
(Myron Marston).Enhancements
--default_path can be specified as --default-line. --line_number can be
specified as --line-number. Hyphens are more idiomatic command line argument
separators (Sam Phippen).format_docstrings { |str| } config option. It can be used to
apply formatting rules to example group and example docstrings.
(Alex Tan).rspec-local options file. This is intended to
allow individual developers to set options in a git-ignored file that
override the common project options in .rspec. (Sam Phippen)Bug fixes
ExampleGroup#ancestors. This is a core ruby method that
RSpec shouldn't override. Instead, define ExampleGroup#parent_groups. (Myron
Marston)shared_examples_for, etc.) to just the objects that need it rather than
every object in the system (Myron Marston).fail_fast so that it properly exits when an error occurs in a
before(:all) hook (Bradley Schaefer).before(:all) are always exposed
from after(:all), even if an error occurs in before(:all)
(Sam Phippen).rspec --init no longer generates an incorrect warning about --configure
being deprecated (Sam Phippen).1 seconds (Odin Dutton)Deprecations
share_as is no longer needed. shared_context and/or
RSpec::SharedContext provide better mechanisms (Sam Phippen).RSpec.configuration with a block (use RSpec.configure).Bug fixes
Enhancements
--example options. (Daniel Doubrovkine @dblock)subject(:article) { Article.new }
config.mock_with and config.expect_with yield custom config object to a
block if given
include_context and include_examples support a block, which gets eval'd
in the current context (vs the nested context generated by it_behaves_like).config.order = 'random' to the spec_helper.rb generated by rspec --init.describe onto just the objects that need it rather
than every object in the system (Myron Marston).Bug fixes
rspec spec\subdir. (Jarmo Pertman @jarmo)--require and -I are merged among different configuration sources (Andy
Lindeman)Bug fixes
RSpec.reset properly reinits configuration and worldto_s before split on exception messages that might not always be
Strings (slyphon)Enhancements
prepend_before and append_after hooks (preethiramdev)
Bug fixes
SPEC_OPTS options.example.description returns the location of the example if there is no
explicit description or matcher-generated description.Enhancements
Bug fixes
--full_backtrace optionconfig.filter_run are respected when running
over DRb (using spork).rescue false from calls to filters represented as Procsdescribed_class gets the closest constant (pyromaniac)at_exit hook if there was an
exception (most likely due to a SyntaxError). (sunaku)its correctly memoizes nil or false values (Yamada Masaki)Bug fixes
rspec path/to/file:37 path/to/file:42Enhancments
--init command (Peter Schröder)
spec/spec_helper.rb--configure command, which generated
.rspecrequire_relative when available (Ian Leitch)include_context and include_examples accept params (Calvin Bascom)Enhancements
--order (Justin Ko)
--order rand--order rand:123--seed SEED
--order rand:SEEDlet (David Chelimsky)--line_number 37 overrides all other filterspath/to/file.rb:37 overrides all other filtersChanges
config.color_enabled (getter/setter/predicate) to color to align
with --[no]-color CLI option.
color_enabled is still supported for now, but will likley be deprecated
in a 2.x release so we can remove it in 3.0.Bug fixes
Make sure the bar in --tag foo:bar makes it to DRb (Aaron Gibralter)
Fix bug where full descriptions of groups nested 3 deep were repeated.
Restore report of time to run to start after files are loaded.
Don't error out when config.mock_with or expect_with is re-specifying the
current config (Myron Marston)
Deprecations
configuration.add_setting. Use :alias_with on the
original setting declaration instead.Bug fixes
NOTE: RSpec's release policy dictates that there should not be any backward incompatible changes in minor releases, but we're making an exception to release a change to how RSpec interacts with other command line tools.
As of 2.7.0, you must explicity require "rspec/autorun" unless you use the
rspec command (which already does this for you).
Enhancements
example.exception (David Chelimsky)--default_path command line option (Justin Ko)--line_number options (David J. Hamilton)
path/to/file.rb:5:9 (runs examples on lines 5 and 9)xspecify and xexample as temp-pending methods (David Chelimsky)--no-drb option (Iain Hecker)--failure-exit-code option (Chris Griego)Bug fixes
Rake::DSL to remove deprecation warnings in Rake > 0.8.7 (Pivotal
Casebook)let block once even if it returns nil (Adam Meehan)--pattern option (wasn't being recognized) (David Chelimsky)require "rspec/autorun" with the rspec command (David
Chelimsky)at_exit defines the exit code (Daniel Doubrovkine)NOTE: RSpec's release policy dictates that there should not be new functionality in patch releases, but this minor enhancement slipped in by accident. As it doesn't add a new API, we decided to leave it in rather than roll back this release.
Enhancements
Bug fixes
Bug fixes
DRb::DRbObject (Julian Scheid)--example command line optionBug fixes
Bug fixes
require 'rspec/autorun' when running rcov.Enhancements
shared_context (Damian Nurzynski)
its([:key]) works for any subject with #[]. (Peter Jaros)treat_symbols_as_metadata_keys_with_true_values (Myron Marston)ConfigurationOptions#parse_options (Rodrigo Rosenfeld Rosas)Bug fixes
example_group_[started|finished] to formatters for empty groups.NOTE: this release breaks compatibility with rspec/autotest/bundler integration, but does so in order to greatly simplify it.
With this release, if you want the generated autotest command to include 'bundle exec', require Autotest's bundler plugin in a .autotest file in the project's root directory or in your home directory:
require "autotest/bundler"
Now you can just type 'autotest' on the command line and it will work as you expect.
If you don't want 'bundle exec', there is nothing you have to do.
Enhancements
Bug fixes
Deprecations
Enhancements
Bug fixes
Bug fixes
Enhancements
Bug fixes
Bug fixes
Deprecations/changes
Enhancements
Bug fixes
Enhancments
Bug fixes
Bug fixes
RSpec-1 compatibility
Bug fixes
Enhancements
Bug fixes
Enhancements
Bug fixes
Removals