rspec-expectations 2.14.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +369 -25
- data/License.txt +1 -0
- data/README.md +88 -15
- data/lib/rspec/{matchers → expectations}/configuration.rb +44 -14
- data/lib/rspec/expectations/expectation_target.rb +67 -33
- data/lib/rspec/expectations/fail_with.rb +11 -53
- data/lib/rspec/expectations/handler.rb +126 -31
- data/lib/rspec/expectations/minitest_integration.rb +16 -0
- data/lib/rspec/expectations/syntax.rb +60 -94
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/expectations.rb +45 -23
- data/lib/rspec/matchers/aliased_matcher.rb +41 -0
- data/lib/rspec/matchers/built_in/all.rb +78 -0
- data/lib/rspec/matchers/built_in/base_matcher.rb +63 -15
- data/lib/rspec/matchers/built_in/be.rb +170 -81
- data/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/lib/rspec/matchers/built_in/be_instance_of.rb +11 -3
- data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -0
- data/lib/rspec/matchers/built_in/be_within.rb +39 -15
- data/lib/rspec/matchers/built_in/change.rb +273 -80
- data/lib/rspec/matchers/built_in/compound.rb +122 -0
- data/lib/rspec/matchers/built_in/contain_exactly.rb +256 -0
- data/lib/rspec/matchers/built_in/cover.rb +3 -0
- data/lib/rspec/matchers/built_in/eq.rb +60 -6
- data/lib/rspec/matchers/built_in/eql.rb +17 -5
- data/lib/rspec/matchers/built_in/equal.rb +55 -21
- data/lib/rspec/matchers/built_in/exist.rb +74 -10
- data/lib/rspec/matchers/built_in/has.rb +71 -15
- data/lib/rspec/matchers/built_in/include.rb +64 -27
- data/lib/rspec/matchers/built_in/match.rb +19 -1
- data/lib/rspec/matchers/built_in/operators.rb +119 -0
- data/lib/rspec/matchers/built_in/output.rb +150 -0
- data/lib/rspec/matchers/built_in/raise_error.rb +84 -42
- data/lib/rspec/matchers/built_in/respond_to.rb +42 -20
- data/lib/rspec/matchers/built_in/satisfy.rb +19 -3
- data/lib/rspec/matchers/built_in/start_and_end_with.rb +54 -18
- data/lib/rspec/matchers/built_in/throw_symbol.rb +38 -8
- data/lib/rspec/matchers/built_in/yield.rb +175 -68
- data/lib/rspec/matchers/built_in.rb +45 -33
- data/lib/rspec/matchers/composable.rb +179 -0
- data/lib/rspec/matchers/dsl.rb +362 -5
- data/lib/rspec/matchers/generated_descriptions.rb +13 -6
- data/lib/rspec/matchers/matcher_delegator.rb +37 -0
- data/lib/rspec/matchers/pretty.rb +27 -20
- data/lib/rspec/matchers.rb +361 -136
- data.tar.gz.sig +1 -0
- metadata +99 -215
- metadata.gz.sig +0 -0
- data/features/README.md +0 -48
- data/features/Upgrade.md +0 -53
- data/features/built_in_matchers/README.md +0 -90
- data/features/built_in_matchers/be.feature +0 -175
- data/features/built_in_matchers/be_within.feature +0 -48
- data/features/built_in_matchers/cover.feature +0 -47
- data/features/built_in_matchers/end_with.feature +0 -48
- data/features/built_in_matchers/equality.feature +0 -139
- data/features/built_in_matchers/exist.feature +0 -45
- data/features/built_in_matchers/expect_change.feature +0 -59
- data/features/built_in_matchers/expect_error.feature +0 -144
- data/features/built_in_matchers/have.feature +0 -109
- data/features/built_in_matchers/include.feature +0 -174
- data/features/built_in_matchers/match.feature +0 -52
- data/features/built_in_matchers/operators.feature +0 -227
- data/features/built_in_matchers/predicates.feature +0 -137
- data/features/built_in_matchers/respond_to.feature +0 -84
- data/features/built_in_matchers/satisfy.feature +0 -33
- data/features/built_in_matchers/start_with.feature +0 -48
- data/features/built_in_matchers/throw_symbol.feature +0 -91
- data/features/built_in_matchers/types.feature +0 -116
- data/features/built_in_matchers/yield.feature +0 -161
- data/features/custom_matchers/access_running_example.feature +0 -53
- data/features/custom_matchers/define_diffable_matcher.feature +0 -27
- data/features/custom_matchers/define_matcher.feature +0 -368
- data/features/custom_matchers/define_matcher_outside_rspec.feature +0 -38
- data/features/custom_matchers/define_matcher_with_fluent_interface.feature +0 -24
- data/features/customized_message.feature +0 -22
- data/features/diffing.feature +0 -85
- data/features/implicit_docstrings.feature +0 -52
- data/features/step_definitions/additional_cli_steps.rb +0 -22
- data/features/support/env.rb +0 -14
- data/features/syntax_configuration.feature +0 -71
- data/features/test_frameworks/test_unit.feature +0 -44
- data/lib/rspec/expectations/deprecation.rb +0 -17
- data/lib/rspec/expectations/differ.rb +0 -133
- data/lib/rspec/expectations/errors.rb +0 -9
- data/lib/rspec/expectations/extensions/array.rb +0 -9
- data/lib/rspec/expectations/extensions/object.rb +0 -29
- data/lib/rspec/expectations/extensions.rb +0 -2
- data/lib/rspec/matchers/be_close.rb +0 -9
- data/lib/rspec/matchers/built_in/have.rb +0 -124
- data/lib/rspec/matchers/built_in/match_array.rb +0 -51
- data/lib/rspec/matchers/compatibility.rb +0 -14
- data/lib/rspec/matchers/extensions/instance_eval_with_args.rb +0 -39
- data/lib/rspec/matchers/matcher.rb +0 -300
- data/lib/rspec/matchers/method_missing.rb +0 -12
- data/lib/rspec/matchers/operator_matcher.rb +0 -109
- data/lib/rspec/matchers/test_unit_integration.rb +0 -11
- data/lib/rspec-expectations.rb +0 -1
- data/spec/rspec/expectations/differ_spec.rb +0 -192
- data/spec/rspec/expectations/expectation_target_spec.rb +0 -82
- data/spec/rspec/expectations/extensions/kernel_spec.rb +0 -67
- data/spec/rspec/expectations/fail_with_spec.rb +0 -114
- data/spec/rspec/expectations/handler_spec.rb +0 -227
- data/spec/rspec/expectations/syntax_spec.rb +0 -139
- data/spec/rspec/matchers/base_matcher_spec.rb +0 -62
- data/spec/rspec/matchers/be_close_spec.rb +0 -22
- data/spec/rspec/matchers/be_instance_of_spec.rb +0 -63
- data/spec/rspec/matchers/be_kind_of_spec.rb +0 -41
- data/spec/rspec/matchers/be_spec.rb +0 -516
- data/spec/rspec/matchers/be_within_spec.rb +0 -137
- data/spec/rspec/matchers/change_spec.rb +0 -553
- data/spec/rspec/matchers/configuration_spec.rb +0 -206
- data/spec/rspec/matchers/cover_spec.rb +0 -69
- data/spec/rspec/matchers/description_generation_spec.rb +0 -190
- data/spec/rspec/matchers/dsl_spec.rb +0 -57
- data/spec/rspec/matchers/eq_spec.rb +0 -60
- data/spec/rspec/matchers/eql_spec.rb +0 -41
- data/spec/rspec/matchers/equal_spec.rb +0 -78
- data/spec/rspec/matchers/exist_spec.rb +0 -124
- data/spec/rspec/matchers/has_spec.rb +0 -122
- data/spec/rspec/matchers/have_spec.rb +0 -455
- data/spec/rspec/matchers/include_matcher_integration_spec.rb +0 -30
- data/spec/rspec/matchers/include_spec.rb +0 -531
- data/spec/rspec/matchers/match_array_spec.rb +0 -194
- data/spec/rspec/matchers/match_spec.rb +0 -61
- data/spec/rspec/matchers/matcher_spec.rb +0 -471
- data/spec/rspec/matchers/matchers_spec.rb +0 -37
- data/spec/rspec/matchers/method_missing_spec.rb +0 -28
- data/spec/rspec/matchers/operator_matcher_spec.rb +0 -223
- data/spec/rspec/matchers/raise_error_spec.rb +0 -485
- data/spec/rspec/matchers/respond_to_spec.rb +0 -292
- data/spec/rspec/matchers/satisfy_spec.rb +0 -44
- data/spec/rspec/matchers/start_with_end_with_spec.rb +0 -186
- data/spec/rspec/matchers/throw_symbol_spec.rb +0 -116
- data/spec/rspec/matchers/yield_spec.rb +0 -514
- data/spec/spec_helper.rb +0 -54
- data/spec/support/classes.rb +0 -56
- data/spec/support/in_sub_process.rb +0 -38
- data/spec/support/matchers.rb +0 -22
- data/spec/support/ruby_version.rb +0 -10
- data/spec/support/shared_examples.rb +0 -13
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
MTJkNmM4ZmNlYTk2M2QyOGIwNWU3MTI3ZGE2ZTQ0OWJhNWM2MTc5NQ==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
YWExNzcwODcxZTBkZWY2MDIyMTI2ZjhjMTYwMjBlZDVkMWNiNjQ2Ng==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
NjdiYjlhYzI4ZDk5YTMyZjFjMjA4OWJlOTQ3MzgwODNhZGNjMWM3ZmZmM2Q0
|
|
10
|
+
NzU3MWFmMzIzYjI0OGE1NzlkZTBlMDI2NmY4ZWUwMjlmN2Y3MTFjODkzOGQ4
|
|
11
|
+
NWQ3NzBhMmQzNGQ2ZjNmZjQ1MjRmMWJjMjE4OTBhNDMyOGJjZTU=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
MzIyOGQ2NjI3MzJmZjM5MTU1ZDdiOTFlZDY5NWMyN2RjOGE4NGNlNGRiYmZk
|
|
14
|
+
NWUxZmVkMTdhMGM5YjdiZmRmNWJmNmM0MDBmMWIyODhlZmM3MzIyYWY0ZmQx
|
|
15
|
+
NTJlYjVlZWQ0NzE4MzBiMjIxNDEyZTE3ZjE0ZDUxOGRkZDQ4MTE=
|
checksums.yaml.gz.sig
ADDED
|
Binary file
|
data/Changelog.md
CHANGED
|
@@ -1,5 +1,349 @@
|
|
|
1
|
+
### 3.0.0 / 2014-06-01
|
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.rc1...v3.0.0)
|
|
3
|
+
|
|
4
|
+
No code changes. Just taking it out of pre-release.
|
|
5
|
+
|
|
6
|
+
### 3.0.0.rc1 / 2014-05-18
|
|
7
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.beta2...v3.0.0.rc1)
|
|
8
|
+
|
|
9
|
+
Breaking Changes for 3.0.0:
|
|
10
|
+
|
|
11
|
+
* Remove `matcher_execution_context` attribute from DSL-defined
|
|
12
|
+
custom matchers. (Myron Marston)
|
|
13
|
+
* Remove `RSpec::Matchers::Pretty#_pretty_print`. (Myron Marston)
|
|
14
|
+
* Remove `RSpec::Matchers::Pretty#expected_to_sentence`. (Myron Marston)
|
|
15
|
+
* Rename `RSpec::Matchers::Configuration` constant to
|
|
16
|
+
`RSpec::Expectations::Configuration`. (Myron Marston)
|
|
17
|
+
* Prevent `have_xyz` predicate matchers using private methods.
|
|
18
|
+
(Adrian Gonzalez)
|
|
19
|
+
* Block matchers must now implement `supports_block_expectations?`.
|
|
20
|
+
(Myron Marston)
|
|
21
|
+
* Stop supporting `require 'rspec-expectations'`.
|
|
22
|
+
Use `require 'rspec/expectations'` instead. (Myron Marston)
|
|
23
|
+
|
|
24
|
+
Bug Fixes:
|
|
25
|
+
|
|
26
|
+
* Fix `NoMethodError` triggered by beta2 when `YARD` was loaded in
|
|
27
|
+
the test environment. (Myron Marston)
|
|
28
|
+
* Fix `be_xyz` matcher to accept a `do...end` block. (Myron Marston)
|
|
29
|
+
* Fix composable matcher failure message generation logic
|
|
30
|
+
so that it does not blow up when given `$stdout` or `$stderr`.
|
|
31
|
+
(Myron Marston)
|
|
32
|
+
* Fix `change` matcher to work properly with `IO` objects.
|
|
33
|
+
(Myron Marston)
|
|
34
|
+
* Fix `exist` matcher so that it can be used in composed matcher
|
|
35
|
+
expressions involving objects that do not implement `exist?` or
|
|
36
|
+
`exists?`. (Daniel Fone)
|
|
37
|
+
* Fix composable matcher match logic so that it clones matchers
|
|
38
|
+
before using them in order to work properly with matchers
|
|
39
|
+
that use internal memoization based on a given `actual` value.
|
|
40
|
+
(Myron Marston)
|
|
41
|
+
* Fix `be_xyz` and `has_xyz` predicate matchers so that they can
|
|
42
|
+
be used in composed matcher expressions involving objects that
|
|
43
|
+
do not implement the predicate method. (Daniel Fone)
|
|
44
|
+
|
|
45
|
+
Enhancements:
|
|
46
|
+
|
|
47
|
+
* Document the remaining public APIs. rspec-expectations now has 100% of
|
|
48
|
+
the public API documented and will remain that way (as new undocumented
|
|
49
|
+
methods will fail the build). (Myron Marston)
|
|
50
|
+
* Improve the formatting of BigDecimal objects in `eq` matcher failure
|
|
51
|
+
messages. (Daniel Fone)
|
|
52
|
+
* Improve the failure message for `be_xyz` predicate matchers so
|
|
53
|
+
that it includes the `inspect` output of the receiver.
|
|
54
|
+
(Erik Michaels-Ober, Sam Phippen)
|
|
55
|
+
* Add `all` matcher, to allow you to specify that a given matcher
|
|
56
|
+
matches all elements in a collection:
|
|
57
|
+
`expect([1, 3, 5]).to all( be_odd )`. (Adam Farhi)
|
|
58
|
+
* Add boolean aliases (`&`/`|`) for compound operators (`and`/`or`). (Adam Farhi)
|
|
59
|
+
* Give users a clear error when they wrongly use a value matcher
|
|
60
|
+
in a block expectation expression (e.g. `expect { 3 }.to eq(3)`)
|
|
61
|
+
or vice versa. (Myron Marston)
|
|
62
|
+
|
|
63
|
+
### 3.0.0.beta2 / 2014-02-17
|
|
64
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.beta1...v3.0.0.beta2)
|
|
65
|
+
|
|
66
|
+
Breaking Changes for 3.0.0:
|
|
67
|
+
|
|
68
|
+
* Remove deprecated support for accessing the `RSpec` constant using
|
|
69
|
+
`Rspec` or `Spec`. (Myron Marston)
|
|
70
|
+
* Remove deprecated `RSpec::Expectations.differ=`. (Myron Marston)
|
|
71
|
+
* Remove support for deprecated `expect(...).should`. (Myron Marston)
|
|
72
|
+
* Explicitly disallow `expect { }.not_to change { }` with `by`,
|
|
73
|
+
`by_at_least`, `by_at_most` or `to`. These have never been supported
|
|
74
|
+
but did not raise explicit errors. (Myron Marston)
|
|
75
|
+
* Provide `===` rather than `==` as an alias of `matches?` for
|
|
76
|
+
all matchers. The semantics of `===` are closer to an RSpec
|
|
77
|
+
matcher than `==`. (Myron Marston)
|
|
78
|
+
* Remove deprecated `RSpec::Matchers::OperatorMatcher` constant.
|
|
79
|
+
(Myron Marston)
|
|
80
|
+
* Make `RSpec::Expectations::ExpectationNotMetError` subclass
|
|
81
|
+
`Exception` rather than `StandardError` so they can bypass
|
|
82
|
+
a bare `rescue` in end-user code (e.g. when an expectation is
|
|
83
|
+
set from within a rspec-mocks stub implementation). (Myron Marston)
|
|
84
|
+
* Remove Test::Unit and Minitest 4.x integration. (Myron Marston)
|
|
85
|
+
|
|
86
|
+
Enhancements:
|
|
87
|
+
|
|
88
|
+
* Simplify the failure message of the `be` matcher when matching against:
|
|
89
|
+
`true`, `false` and `nil`. (Sam Phippen)
|
|
90
|
+
* Update matcher protocol and custom matcher DSL to better align
|
|
91
|
+
with the newer `expect` syntax. If you want your matchers to
|
|
92
|
+
maintain compatibility with multiple versions of RSpec, you can
|
|
93
|
+
alias the new names to the old. (Myron Marston)
|
|
94
|
+
* `failure_message_for_should` => `failure_message`
|
|
95
|
+
* `failure_message_for_should_not` => `failure_message_when_negated`
|
|
96
|
+
* `match_for_should` => `match`
|
|
97
|
+
* `match_for_should_not` => `match_when_negated`
|
|
98
|
+
* Improve generated descriptions from `change` matcher. (Myron Marston)
|
|
99
|
+
* Add support for compound matcher expressions using `and` and `or`.
|
|
100
|
+
Simply chain them off of any existing matcher to create an expression
|
|
101
|
+
like `expect(alphabet).to start_with("a").and end_with("z")`.
|
|
102
|
+
(Eloy Espinaco)
|
|
103
|
+
* Add `contain_exactly` as a less ambiguous version of `match_array`.
|
|
104
|
+
Note that it expects the expected array to be splatted as
|
|
105
|
+
individual args: `expect(array).to contain_exactly(1, 2)` is
|
|
106
|
+
the same as `expect(array).to match_array([1, 2])`. (Myron Marston)
|
|
107
|
+
* Update `contain_exactly`/`match_array` so that it can match against
|
|
108
|
+
other non-array collections (such as a `Set`). (Myron Marston)
|
|
109
|
+
* Update built-in matchers so that they can accept matchers as arguments
|
|
110
|
+
to allow you to compose matchers in arbitrary ways. (Myron Marston)
|
|
111
|
+
* Add `RSpec::Matchers::Composable` mixin that can be used to make
|
|
112
|
+
a custom matcher composable as well. Note that custom matchers
|
|
113
|
+
defined via `RSpec::Matchers.define` already have this. (Myron
|
|
114
|
+
Marston)
|
|
115
|
+
* Define noun-phrase aliases for built-in matchers, which can be
|
|
116
|
+
used when creating composed matcher expressions that read better
|
|
117
|
+
and provide better failure messages. (Myron Marston)
|
|
118
|
+
* Add `RSpec::Machers.alias_matcher` so users can define their own
|
|
119
|
+
matcher aliases. The `description` of the matcher will reflect the
|
|
120
|
+
alternate matcher name. (Myron Marston)
|
|
121
|
+
* Add explicit `be_between` matcher. `be_between` has worked for a
|
|
122
|
+
long time as a dynamic predicate matcher, but the failure message
|
|
123
|
+
was suboptimal. The new matcher provides a much better failure
|
|
124
|
+
message. (Erik Michaels-Ober)
|
|
125
|
+
* Enhance the `be_between` matcher to allow for `inclusive` or `exclusive`
|
|
126
|
+
comparison (e.g. inclusive of min/max or exclusive of min/max).
|
|
127
|
+
(Pedro Gimenez)
|
|
128
|
+
* Make failure message for `not_to be #{operator}` less confusing by
|
|
129
|
+
only saying it's confusing when comparison operators are used.
|
|
130
|
+
(Prathamesh Sonpatki)
|
|
131
|
+
* Improve failure message of `eq` matcher when `Time` or `DateTime`
|
|
132
|
+
objects are used so that the full sub-second precision is included.
|
|
133
|
+
(Thomas Holmes, Jeff Wallace)
|
|
134
|
+
* Add `output` matcher for expecting that a block outputs `to_stdout`
|
|
135
|
+
or `to_stderr`. (Luca Pette, Matthias Günther)
|
|
136
|
+
* Forward a provided block on to the `has_xyz?` method call when
|
|
137
|
+
the `have_xyz` matcher is used. (Damian Galarza)
|
|
138
|
+
* Provide integration with Minitest 5.x. Require
|
|
139
|
+
`rspec/expectations/minitest_integration` after loading minitest
|
|
140
|
+
to use rspec-expectations with minitest. (Myron Marston)
|
|
141
|
+
|
|
142
|
+
Bug Fixes:
|
|
143
|
+
|
|
144
|
+
* Fix wrong matcher descriptions with falsey expected value (yujinakayama)
|
|
145
|
+
* Fix `expect { }.not_to change { }.from(x)` so that the matcher only
|
|
146
|
+
passes if the starting value is `x`. (Tyler Rick, Myron Marston)
|
|
147
|
+
* Fix hash diffing, so that it colorizes properly and doesn't consider trailing
|
|
148
|
+
commas when performing the diff. (Jared Norman)
|
|
149
|
+
* Fix built-in matchers to fail normally rather than raising
|
|
150
|
+
`ArgumentError` when given an object of the wrong type to match
|
|
151
|
+
against, so that they work well in composite matcher expressions like
|
|
152
|
+
`expect([1.51, "foo"]).to include(a_string_matching(/foo/), a_value_within(0.1).of(1.5))`.
|
|
153
|
+
(Myron Marston)
|
|
154
|
+
|
|
155
|
+
Deprecations:
|
|
156
|
+
|
|
157
|
+
* Retain support for RSpec 2 matcher protocol (e.g. for matchers
|
|
158
|
+
in 3rd party extension gems like `shoulda`), but it will print
|
|
159
|
+
a deprecation warning. (Myron Marston)
|
|
160
|
+
|
|
161
|
+
### 3.0.0.beta1 / 2013-11-07
|
|
162
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0...v3.0.0.beta1)
|
|
163
|
+
|
|
164
|
+
Breaking Changes for 3.0.0:
|
|
165
|
+
|
|
166
|
+
* Remove explicit support for 1.8.6. (Jon Rowe)
|
|
167
|
+
* Remove the deprecated `be_close` matcher, preferring `be_within` instead.
|
|
168
|
+
(Sam Phippen)
|
|
169
|
+
* Remove the deprecated `have`, `have_at_least` and `have_at_most` matchers.
|
|
170
|
+
You can continue using those matchers through https://github.com/rspec/rspec-collection_matchers,
|
|
171
|
+
or you can rewrite your expectations with something like
|
|
172
|
+
`expect(your_object.size).to eq(num)`. (Hugo Baraúna)
|
|
173
|
+
* Rename `be_true` and `be_false` to `be_truthy` and `be_falsey`. (Sam Phippen)
|
|
174
|
+
* Make `expect { }.to_not raise_error(SomeSpecificClass, message)`,
|
|
175
|
+
`expect { }.to_not raise_error(SomeSpecificClass)` and
|
|
176
|
+
`expect { }.to_not raise_error(message)` invalid, since they are prone
|
|
177
|
+
to hiding failures. Instead, use `expect { }.to_not raise_error` (with no
|
|
178
|
+
args). (Sam Phippen)
|
|
179
|
+
* Within `RSpec::Matchers.define` blocks, helper methods made available
|
|
180
|
+
either via `def self.helper` or `extend HelperModule` are no longer
|
|
181
|
+
available to the `match` block (or any of the others). Instead
|
|
182
|
+
`include` your helper module and define the helper method as an
|
|
183
|
+
instance method. (Myron Marston)
|
|
184
|
+
* Force upgrading Diff::LCS for encoding compatability with diffs. (Jon Rowe)
|
|
185
|
+
|
|
186
|
+
Enhancements:
|
|
187
|
+
|
|
188
|
+
* Support `do..end` style block with `raise_error` matcher. (Yuji Nakayama)
|
|
189
|
+
* Rewrote custom matcher DSL to simplify its implementation and solve a
|
|
190
|
+
few issues. (Myron Marston)
|
|
191
|
+
* Allow early `return` from within custom matcher DSL blocks. (Myron
|
|
192
|
+
Marston)
|
|
193
|
+
* The custom matcher DSL's `chain` can now accept a block. (Myron
|
|
194
|
+
Marston)
|
|
195
|
+
* Support setting an expectation on a `raise_error` matcher via a chained
|
|
196
|
+
`with_message` method call. (Sam Phippen)
|
|
197
|
+
|
|
198
|
+
Bug Fixes:
|
|
199
|
+
|
|
200
|
+
* Allow `include` and `match` matchers to be used from within a
|
|
201
|
+
DSL-defined custom matcher's `match` block. (Myron Marston)
|
|
202
|
+
* Correct encoding error message on diff failure (Jon Rowe)
|
|
203
|
+
|
|
204
|
+
Deprecations:
|
|
205
|
+
|
|
206
|
+
* Using the old `:should` syntax without explicitly configuring it is deprecated.
|
|
207
|
+
It will continue to work but will emit a deprecation warning in RSpec 3 if
|
|
208
|
+
you do not explicitly enable it. (Sam Phippen)
|
|
209
|
+
|
|
210
|
+
### 2.99.0 / 2014-06-01
|
|
211
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.rc1...v2.99.0)
|
|
212
|
+
|
|
213
|
+
Enhancements:
|
|
214
|
+
|
|
215
|
+
* Special case deprecation message for `errors_on` with `rspec-rails` to be more useful.
|
|
216
|
+
(Aaron Kromer)
|
|
217
|
+
|
|
218
|
+
### 2.99.0.rc1 / 2014-05-18
|
|
219
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta2...2.99.0.rc1)
|
|
220
|
+
|
|
221
|
+
Deprecations:
|
|
222
|
+
|
|
223
|
+
* Deprecate `matcher_execution_context` attribute on DSL-defined
|
|
224
|
+
custom matchers. (Myron Marston)
|
|
225
|
+
* Deprecate `RSpec::Matchers::Pretty#_pretty_print`. (Myron Marston)
|
|
226
|
+
* Deprecate `RSpec::Matchers::Pretty#expected_to_sentence`. (Myron Marston)
|
|
227
|
+
* Deprecate `RSpec::Matchers::Configuration` in favor of
|
|
228
|
+
`RSpec::Expectations::Configuration`. (Myron Marston)
|
|
229
|
+
* Deprecate `be_xyz` predicate matcher on an object that doesn't respond to
|
|
230
|
+
`xyz?` or `xyzs?`. (Daniel Fone)
|
|
231
|
+
* Deprecate `have_xyz` matcher on an object that doesn't respond to `has_xyz?`.
|
|
232
|
+
(Daniel Fone)
|
|
233
|
+
* Deprecate `have_xyz` matcher on an object that has a private method `has_xyz?`.
|
|
234
|
+
(Jon Rowe)
|
|
235
|
+
* Issue a deprecation warning when a block expectation expression is
|
|
236
|
+
used with a matcher that doesn't explicitly support block expectations
|
|
237
|
+
via `supports_block_expectations?`. (Myron Marston)
|
|
238
|
+
* Deprecate `require 'rspec-expectations'`. Use
|
|
239
|
+
`require 'rspec/expectations'` instead. (Myron Marston)
|
|
240
|
+
|
|
241
|
+
### 2.99.0.beta2 / 2014-02-17
|
|
242
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta1...v2.99.0.beta2)
|
|
243
|
+
|
|
244
|
+
Deprecations:
|
|
245
|
+
|
|
246
|
+
* Deprecate chaining `by`, `by_at_least`, `by_at_most` or `to` off of
|
|
247
|
+
`expect { }.not_to change { }`. The docs have always said these are
|
|
248
|
+
not supported for the negative form but now they explicitly raise
|
|
249
|
+
errors in RSpec 3. (Myron Marston)
|
|
250
|
+
* Change the semantics of `expect { }.not_to change { x }.from(y)`.
|
|
251
|
+
In RSpec 2.x, this expectation would only fail if `x` started with
|
|
252
|
+
the value of `y` and changed. If it started with a different value
|
|
253
|
+
and changed, it would pass. In RSpec 3, it will pass only if the
|
|
254
|
+
value starts at `y` and it does not change. (Myron Marston)
|
|
255
|
+
* Deprecate `matcher == value` as an alias for `matcher.matches?(value)`,
|
|
256
|
+
in favor of `matcher === value`. (Myron Marston)
|
|
257
|
+
* Deprecate `RSpec::Matchers::OperatorMatcher` in favor of
|
|
258
|
+
`RSpec::Matchers::BuiltIn::OperatorMatcher`. (Myron Marston)
|
|
259
|
+
* Deprecate auto-integration with Test::Unit and minitest.
|
|
260
|
+
Instead, include `RSpec::Matchers` in the appropriate test case
|
|
261
|
+
base class yourself. (Myron Marston)
|
|
262
|
+
* Deprecate treating `#expected` on a DSL-generated custom matcher
|
|
263
|
+
as an array when only 1 argument is passed to the matcher method.
|
|
264
|
+
In RSpec 3 it will be the single value in order to make diffs
|
|
265
|
+
work properly. (Jon Rowe)
|
|
266
|
+
|
|
267
|
+
### 2.99.0.beta1 / 2013-11-07
|
|
268
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.99.0.beta1)
|
|
269
|
+
|
|
270
|
+
Deprecations
|
|
271
|
+
|
|
272
|
+
* Deprecate `have`, `have_at_least` and `have_at_most`. You can continue using those
|
|
273
|
+
matchers through https://github.com/rspec/rspec-collection_matchers, or
|
|
274
|
+
you can rewrite your expectations with something like
|
|
275
|
+
`expect(your_object.size).to eq(num)`. (Hugo Baraúna)
|
|
276
|
+
* Deprecate `be_xyz` predicate matcher when `xyz?` is a private method.
|
|
277
|
+
(Jon Rowe)
|
|
278
|
+
* Deprecate `be_true`/`be_false` in favour of `be_truthy`/`be_falsey`
|
|
279
|
+
(for Ruby's conditional semantics) or `be true`/`be false`
|
|
280
|
+
(for exact equality). (Sam Phippen)
|
|
281
|
+
* Deprecate calling helper methods from a custom matcher with the wrong
|
|
282
|
+
scope. (Myron Marston)
|
|
283
|
+
* `def self.foo` / `extend Helper` can be used to add macro methods
|
|
284
|
+
(e.g. methods that call the custom matcher DSL methods), but should
|
|
285
|
+
not be used to define helper methods called from within the DSL
|
|
286
|
+
blocks.
|
|
287
|
+
* `def foo` / `include Helper` is the opposite: it's for helper methods
|
|
288
|
+
callable from within a DSL block, but not for defining macros.
|
|
289
|
+
* RSpec 2.x allowed helper methods defined either way to be used for
|
|
290
|
+
either purpose, but RSpec 3.0 will not.
|
|
291
|
+
|
|
292
|
+
### 2.14.5 / 2014-02-01
|
|
293
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.14.5)
|
|
294
|
+
|
|
295
|
+
Bug fixes
|
|
296
|
+
|
|
297
|
+
* Fix wrong matcher descriptions with falsey expected value
|
|
298
|
+
(yujinakayama)
|
|
299
|
+
|
|
300
|
+
### 2.14.4 / 2013-11-06
|
|
301
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.3...v2.14.4)
|
|
302
|
+
|
|
303
|
+
Bug fixes
|
|
304
|
+
|
|
305
|
+
* Make the `match` matcher produce a diff output. (Jon Rowe, Ben Moss)
|
|
306
|
+
* Choose encoding for diff's more intelligently, and when all else fails fall
|
|
307
|
+
back to default internal encoding with replacing characters. (Jon Rowe)
|
|
308
|
+
|
|
309
|
+
### 2.14.3 / 2013-09-22
|
|
310
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.2...v2.14.3)
|
|
311
|
+
|
|
312
|
+
Bug fixes
|
|
313
|
+
|
|
314
|
+
* Fix operator matchers (`should` syntax) when `method` is redefined on target.
|
|
315
|
+
(Brandon Turner)
|
|
316
|
+
* Fix diffing of hashes with object based keys. (Jon Rowe)
|
|
317
|
+
* Fix operator matchers (`should` syntax) when operator is defined via
|
|
318
|
+
`method_missing` (Jon Rowe)
|
|
319
|
+
|
|
320
|
+
### 2.14.2 / 2013-08-14
|
|
321
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.1...v2.14.2)
|
|
322
|
+
|
|
323
|
+
Bug fixes
|
|
324
|
+
|
|
325
|
+
* Fix `be_<predicate>` matcher to not support operator chaining like the
|
|
326
|
+
`be` matcher does (e.g. `be == 5`). This led to some odd behaviors
|
|
327
|
+
since `be_<predicate> == anything` returned a `BeComparedTo` matcher
|
|
328
|
+
and was thus always truthy. This was a consequence of the implementation
|
|
329
|
+
(e.g. subclassing the basic `Be` matcher) and was not intended behavior.
|
|
330
|
+
(Myron Marston).
|
|
331
|
+
* Fix `change` matcher to compare using `==` in addition to `===`. This
|
|
332
|
+
is important for an expression like:
|
|
333
|
+
`expect {}.to change { a.class }.from(ClassA).to(ClassB)` because
|
|
334
|
+
`SomeClass === SomeClass` returns false. (Myron Marston)
|
|
335
|
+
|
|
336
|
+
### 2.14.1 / 2013-08-08
|
|
337
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0...2.14.1)
|
|
338
|
+
|
|
339
|
+
Bug fixes
|
|
340
|
+
|
|
341
|
+
* Ensure diff output uses the same encoding as the encoding of
|
|
342
|
+
the string being diff'd to prevent `Encoding::UndefinedConversionError`
|
|
343
|
+
errors (Jon Rowe).
|
|
344
|
+
|
|
1
345
|
### 2.14.0 / 2013-07-06
|
|
2
|
-
[
|
|
346
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0.rc1...v2.14.0)
|
|
3
347
|
|
|
4
348
|
Bug fixes
|
|
5
349
|
|
|
@@ -11,7 +355,7 @@ Bug fixes
|
|
|
11
355
|
change...` (Sam Phippen).
|
|
12
356
|
|
|
13
357
|
### 2.14.0.rc1 / 2013-05-27
|
|
14
|
-
[
|
|
358
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.13.0...v2.14.0.rc1)
|
|
15
359
|
|
|
16
360
|
Enhancements
|
|
17
361
|
|
|
@@ -45,7 +389,7 @@ Deprecations
|
|
|
45
389
|
error_ to pass. (Sam Phippen and David Chelimsky)
|
|
46
390
|
|
|
47
391
|
### 2.13.0 / 2013-02-23
|
|
48
|
-
[
|
|
392
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
|
|
49
393
|
|
|
50
394
|
Enhancements
|
|
51
395
|
|
|
@@ -76,7 +420,7 @@ Bug fixes
|
|
|
76
420
|
printed for empty diffs (Myron Marston).
|
|
77
421
|
|
|
78
422
|
### 2.12.1 / 2012-12-15
|
|
79
|
-
[
|
|
423
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
|
|
80
424
|
|
|
81
425
|
Bug fixes
|
|
82
426
|
|
|
@@ -88,7 +432,7 @@ Bug fixes
|
|
|
88
432
|
(Steven Harman)
|
|
89
433
|
|
|
90
434
|
### 2.12.0 / 2012-11-12
|
|
91
|
-
[
|
|
435
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...v2.12.0)
|
|
92
436
|
|
|
93
437
|
Enhancements
|
|
94
438
|
|
|
@@ -111,7 +455,7 @@ Bug fixes
|
|
|
111
455
|
(Tom Stuart)
|
|
112
456
|
|
|
113
457
|
### 2.11.3 / 2012-09-04
|
|
114
|
-
[
|
|
458
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
|
|
115
459
|
|
|
116
460
|
Bug fixes
|
|
117
461
|
|
|
@@ -127,7 +471,7 @@ Bug fixes
|
|
|
127
471
|
}.to change { user.last_emailed_at }.to be_within(1.second).of(Time.zone.now)
|
|
128
472
|
|
|
129
473
|
### 2.11.2 / 2012-07-25
|
|
130
|
-
[
|
|
474
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
|
|
131
475
|
|
|
132
476
|
Bug fixes
|
|
133
477
|
|
|
@@ -136,7 +480,7 @@ Bug fixes
|
|
|
136
480
|
of the object hierarchy. (Gabriel Gilder)
|
|
137
481
|
|
|
138
482
|
### 2.11.1 / 2012-07-08
|
|
139
|
-
[
|
|
483
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
|
|
140
484
|
|
|
141
485
|
Bug fixes
|
|
142
486
|
|
|
@@ -145,7 +489,7 @@ Bug fixes
|
|
|
145
489
|
* `Time`, for example, is a legit alternative.
|
|
146
490
|
|
|
147
491
|
### 2.11.0 / 2012-07-07
|
|
148
|
-
[
|
|
492
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
|
|
149
493
|
|
|
150
494
|
Enhancements
|
|
151
495
|
|
|
@@ -168,7 +512,7 @@ Bug fixes
|
|
|
168
512
|
Marston)
|
|
169
513
|
|
|
170
514
|
### 2.10.0 / 2012-05-03
|
|
171
|
-
[
|
|
515
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.1...v2.10.0)
|
|
172
516
|
|
|
173
517
|
Enhancements
|
|
174
518
|
|
|
@@ -186,7 +530,7 @@ Bug fixes
|
|
|
186
530
|
* Fix message-specific specs to pass on Rubinius (John Firebaugh)
|
|
187
531
|
|
|
188
532
|
### 2.9.1 / 2012-04-03
|
|
189
|
-
[
|
|
533
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...v2.9.1)
|
|
190
534
|
|
|
191
535
|
Bug fixes
|
|
192
536
|
|
|
@@ -197,7 +541,7 @@ Bug fixes
|
|
|
197
541
|
* Fix using execution context methods in nested DSL matchers (mirasrael)
|
|
198
542
|
|
|
199
543
|
### 2.9.0 / 2012-03-17
|
|
200
|
-
[
|
|
544
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
|
|
201
545
|
|
|
202
546
|
Enhancements
|
|
203
547
|
|
|
@@ -217,7 +561,7 @@ Bug fixes
|
|
|
217
561
|
|
|
218
562
|
### 2.8.0 / 2012-01-04
|
|
219
563
|
|
|
220
|
-
[
|
|
564
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc2...v2.8.0)
|
|
221
565
|
|
|
222
566
|
Enhancements
|
|
223
567
|
|
|
@@ -226,13 +570,13 @@ Enhancements
|
|
|
226
570
|
|
|
227
571
|
### 2.8.0.rc2 / 2011-12-19
|
|
228
572
|
|
|
229
|
-
[
|
|
573
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc1...v2.8.0.rc2)
|
|
230
574
|
|
|
231
575
|
No changes for this release. Just releasing with the other rspec gems.
|
|
232
576
|
|
|
233
577
|
### 2.8.0.rc1 / 2011-11-06
|
|
234
578
|
|
|
235
|
-
[
|
|
579
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.7.0...v2.8.0.rc1)
|
|
236
580
|
|
|
237
581
|
Enhancements
|
|
238
582
|
|
|
@@ -241,7 +585,7 @@ Enhancements
|
|
|
241
585
|
|
|
242
586
|
### 2.7.0 / 2011-10-16
|
|
243
587
|
|
|
244
|
-
[
|
|
588
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.6.0...v2.7.0)
|
|
245
589
|
|
|
246
590
|
Enhancements
|
|
247
591
|
|
|
@@ -259,7 +603,7 @@ Bug fixes
|
|
|
259
603
|
|
|
260
604
|
### 2.6.0 / 2011-05-12
|
|
261
605
|
|
|
262
|
-
[
|
|
606
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.5.0...v2.6.0)
|
|
263
607
|
|
|
264
608
|
Enhancements
|
|
265
609
|
|
|
@@ -277,7 +621,7 @@ Bug fixes
|
|
|
277
621
|
|
|
278
622
|
### 2.5.0 / 2011-02-05
|
|
279
623
|
|
|
280
|
-
[
|
|
624
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.4.0...v2.5.0)
|
|
281
625
|
|
|
282
626
|
Enhancements
|
|
283
627
|
|
|
@@ -290,7 +634,7 @@ Documentation
|
|
|
290
634
|
|
|
291
635
|
### 2.4.0 / 2011-01-02
|
|
292
636
|
|
|
293
|
-
[
|
|
637
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.3.0...v2.4.0)
|
|
294
638
|
|
|
295
639
|
No functional changes in this release, which was made to align with the
|
|
296
640
|
rspec-core-2.4.0 release.
|
|
@@ -301,7 +645,7 @@ Enhancements
|
|
|
301
645
|
|
|
302
646
|
### 2.3.0 / 2010-12-12
|
|
303
647
|
|
|
304
|
-
[
|
|
648
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.2.1...v2.3.0)
|
|
305
649
|
|
|
306
650
|
Enhancements
|
|
307
651
|
|
|
@@ -309,11 +653,11 @@ Enhancements
|
|
|
309
653
|
|
|
310
654
|
### 2.2.0 / 2010-11-28
|
|
311
655
|
|
|
312
|
-
[
|
|
656
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.1.0...v2.2.0)
|
|
313
657
|
|
|
314
658
|
### 2.1.0 / 2010-11-07
|
|
315
659
|
|
|
316
|
-
[
|
|
660
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.1...v2.1.0)
|
|
317
661
|
|
|
318
662
|
Enhancements
|
|
319
663
|
|
|
@@ -332,7 +676,7 @@ Bug fixes
|
|
|
332
676
|
|
|
333
677
|
### 2.0.0 / 2010-10-10
|
|
334
678
|
|
|
335
|
-
[
|
|
679
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.rc...v2.0.0)
|
|
336
680
|
|
|
337
681
|
Enhancements
|
|
338
682
|
|
|
@@ -347,7 +691,7 @@ Bug fixes
|
|
|
347
691
|
|
|
348
692
|
### 2.0.0.rc / 2010-10-05
|
|
349
693
|
|
|
350
|
-
[
|
|
694
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.22...v2.0.0.rc)
|
|
351
695
|
|
|
352
696
|
Enhancements
|
|
353
697
|
|
|
@@ -360,7 +704,7 @@ Bug fixes
|
|
|
360
704
|
|
|
361
705
|
### 2.0.0.beta.22 / 2010-09-12
|
|
362
706
|
|
|
363
|
-
[
|
|
707
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.20...v2.0.0.beta.22)
|
|
364
708
|
|
|
365
709
|
Enhancements
|
|
366
710
|
|