rspec-expectations 2.13.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.
Files changed (142) hide show
  1. checksums.yaml +15 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/Changelog.md +413 -23
  4. data/License.txt +1 -0
  5. data/README.md +109 -80
  6. data/lib/rspec/{matchers → expectations}/configuration.rb +44 -14
  7. data/lib/rspec/expectations/expectation_target.rb +71 -38
  8. data/lib/rspec/expectations/fail_with.rb +12 -44
  9. data/lib/rspec/expectations/handler.rb +135 -35
  10. data/lib/rspec/expectations/minitest_integration.rb +16 -0
  11. data/lib/rspec/expectations/syntax.rb +60 -94
  12. data/lib/rspec/expectations/version.rb +1 -1
  13. data/lib/rspec/expectations.rb +46 -24
  14. data/lib/rspec/matchers/aliased_matcher.rb +41 -0
  15. data/lib/rspec/matchers/built_in/all.rb +78 -0
  16. data/lib/rspec/matchers/built_in/base_matcher.rb +63 -15
  17. data/lib/rspec/matchers/built_in/be.rb +170 -79
  18. data/lib/rspec/matchers/built_in/be_between.rb +77 -0
  19. data/lib/rspec/matchers/built_in/be_instance_of.rb +11 -3
  20. data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -0
  21. data/lib/rspec/matchers/built_in/be_within.rb +40 -16
  22. data/lib/rspec/matchers/built_in/change.rb +275 -74
  23. data/lib/rspec/matchers/built_in/compound.rb +122 -0
  24. data/lib/rspec/matchers/built_in/contain_exactly.rb +256 -0
  25. data/lib/rspec/matchers/built_in/cover.rb +3 -0
  26. data/lib/rspec/matchers/built_in/eq.rb +60 -6
  27. data/lib/rspec/matchers/built_in/eql.rb +17 -5
  28. data/lib/rspec/matchers/built_in/equal.rb +55 -21
  29. data/lib/rspec/matchers/built_in/exist.rb +74 -10
  30. data/lib/rspec/matchers/built_in/has.rb +71 -15
  31. data/lib/rspec/matchers/built_in/include.rb +58 -29
  32. data/lib/rspec/matchers/built_in/match.rb +19 -1
  33. data/lib/rspec/matchers/built_in/operators.rb +119 -0
  34. data/lib/rspec/matchers/built_in/output.rb +150 -0
  35. data/lib/rspec/matchers/built_in/raise_error.rb +91 -33
  36. data/lib/rspec/matchers/built_in/respond_to.rb +42 -20
  37. data/lib/rspec/matchers/built_in/satisfy.rb +19 -3
  38. data/lib/rspec/matchers/built_in/start_and_end_with.rb +54 -18
  39. data/lib/rspec/matchers/built_in/throw_symbol.rb +38 -8
  40. data/lib/rspec/matchers/built_in/yield.rb +237 -55
  41. data/lib/rspec/matchers/built_in.rb +45 -33
  42. data/lib/rspec/matchers/composable.rb +179 -0
  43. data/lib/rspec/matchers/dsl.rb +362 -5
  44. data/lib/rspec/matchers/generated_descriptions.rb +13 -6
  45. data/lib/rspec/matchers/matcher_delegator.rb +37 -0
  46. data/lib/rspec/matchers/pretty.rb +33 -20
  47. data/lib/rspec/matchers.rb +450 -227
  48. data.tar.gz.sig +1 -0
  49. metadata +100 -215
  50. metadata.gz.sig +0 -0
  51. data/features/README.md +0 -49
  52. data/features/Upgrade.md +0 -53
  53. data/features/built_in_matchers/README.md +0 -90
  54. data/features/built_in_matchers/be.feature +0 -175
  55. data/features/built_in_matchers/be_within.feature +0 -48
  56. data/features/built_in_matchers/cover.feature +0 -47
  57. data/features/built_in_matchers/end_with.feature +0 -48
  58. data/features/built_in_matchers/equality.feature +0 -139
  59. data/features/built_in_matchers/exist.feature +0 -45
  60. data/features/built_in_matchers/expect_change.feature +0 -59
  61. data/features/built_in_matchers/expect_error.feature +0 -144
  62. data/features/built_in_matchers/have.feature +0 -109
  63. data/features/built_in_matchers/include.feature +0 -174
  64. data/features/built_in_matchers/match.feature +0 -52
  65. data/features/built_in_matchers/operators.feature +0 -227
  66. data/features/built_in_matchers/predicates.feature +0 -137
  67. data/features/built_in_matchers/respond_to.feature +0 -84
  68. data/features/built_in_matchers/satisfy.feature +0 -33
  69. data/features/built_in_matchers/start_with.feature +0 -48
  70. data/features/built_in_matchers/throw_symbol.feature +0 -91
  71. data/features/built_in_matchers/types.feature +0 -116
  72. data/features/built_in_matchers/yield.feature +0 -146
  73. data/features/custom_matchers/access_running_example.feature +0 -53
  74. data/features/custom_matchers/define_diffable_matcher.feature +0 -27
  75. data/features/custom_matchers/define_matcher.feature +0 -368
  76. data/features/custom_matchers/define_matcher_outside_rspec.feature +0 -38
  77. data/features/custom_matchers/define_matcher_with_fluent_interface.feature +0 -24
  78. data/features/customized_message.feature +0 -22
  79. data/features/diffing.feature +0 -85
  80. data/features/implicit_docstrings.feature +0 -52
  81. data/features/step_definitions/additional_cli_steps.rb +0 -22
  82. data/features/support/env.rb +0 -5
  83. data/features/syntax_configuration.feature +0 -68
  84. data/features/test_frameworks/test_unit.feature +0 -46
  85. data/lib/rspec/expectations/deprecation.rb +0 -38
  86. data/lib/rspec/expectations/differ.rb +0 -115
  87. data/lib/rspec/expectations/errors.rb +0 -9
  88. data/lib/rspec/expectations/extensions/array.rb +0 -9
  89. data/lib/rspec/expectations/extensions/object.rb +0 -39
  90. data/lib/rspec/expectations/extensions.rb +0 -2
  91. data/lib/rspec/matchers/be_close.rb +0 -9
  92. data/lib/rspec/matchers/built_in/have.rb +0 -108
  93. data/lib/rspec/matchers/built_in/match_array.rb +0 -51
  94. data/lib/rspec/matchers/compatibility.rb +0 -14
  95. data/lib/rspec/matchers/extensions/instance_eval_with_args.rb +0 -39
  96. data/lib/rspec/matchers/matcher.rb +0 -300
  97. data/lib/rspec/matchers/method_missing.rb +0 -12
  98. data/lib/rspec/matchers/operator_matcher.rb +0 -109
  99. data/lib/rspec-expectations.rb +0 -1
  100. data/spec/rspec/expectations/differ_spec.rb +0 -170
  101. data/spec/rspec/expectations/expectation_target_spec.rb +0 -75
  102. data/spec/rspec/expectations/extensions/kernel_spec.rb +0 -67
  103. data/spec/rspec/expectations/fail_with_spec.rb +0 -95
  104. data/spec/rspec/expectations/handler_spec.rb +0 -206
  105. data/spec/rspec/expectations/syntax_spec.rb +0 -97
  106. data/spec/rspec/matchers/base_matcher_spec.rb +0 -62
  107. data/spec/rspec/matchers/be_close_spec.rb +0 -22
  108. data/spec/rspec/matchers/be_instance_of_spec.rb +0 -63
  109. data/spec/rspec/matchers/be_kind_of_spec.rb +0 -41
  110. data/spec/rspec/matchers/be_spec.rb +0 -516
  111. data/spec/rspec/matchers/be_within_spec.rb +0 -129
  112. data/spec/rspec/matchers/change_spec.rb +0 -542
  113. data/spec/rspec/matchers/configuration_spec.rb +0 -238
  114. data/spec/rspec/matchers/cover_spec.rb +0 -69
  115. data/spec/rspec/matchers/description_generation_spec.rb +0 -176
  116. data/spec/rspec/matchers/dsl_spec.rb +0 -57
  117. data/spec/rspec/matchers/eq_spec.rb +0 -60
  118. data/spec/rspec/matchers/eql_spec.rb +0 -41
  119. data/spec/rspec/matchers/equal_spec.rb +0 -78
  120. data/spec/rspec/matchers/exist_spec.rb +0 -124
  121. data/spec/rspec/matchers/has_spec.rb +0 -122
  122. data/spec/rspec/matchers/have_spec.rb +0 -445
  123. data/spec/rspec/matchers/include_matcher_integration_spec.rb +0 -30
  124. data/spec/rspec/matchers/include_spec.rb +0 -531
  125. data/spec/rspec/matchers/match_array_spec.rb +0 -194
  126. data/spec/rspec/matchers/match_spec.rb +0 -61
  127. data/spec/rspec/matchers/matcher_spec.rb +0 -471
  128. data/spec/rspec/matchers/matchers_spec.rb +0 -37
  129. data/spec/rspec/matchers/method_missing_spec.rb +0 -28
  130. data/spec/rspec/matchers/operator_matcher_spec.rb +0 -223
  131. data/spec/rspec/matchers/raise_error_spec.rb +0 -395
  132. data/spec/rspec/matchers/respond_to_spec.rb +0 -292
  133. data/spec/rspec/matchers/satisfy_spec.rb +0 -44
  134. data/spec/rspec/matchers/start_with_end_with_spec.rb +0 -186
  135. data/spec/rspec/matchers/throw_symbol_spec.rb +0 -116
  136. data/spec/rspec/matchers/yield_spec.rb +0 -437
  137. data/spec/spec_helper.rb +0 -54
  138. data/spec/support/classes.rb +0 -56
  139. data/spec/support/in_sub_process.rb +0 -38
  140. data/spec/support/matchers.rb +0 -22
  141. data/spec/support/ruby_version.rb +0 -10
  142. 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,395 @@
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
+
345
+ ### 2.14.0 / 2013-07-06
346
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0.rc1...v2.14.0)
347
+
348
+ Bug fixes
349
+
350
+ * Values that are not matchers use `#inspect`, rather than `#description` for
351
+ documentation output (Andy Lindeman, Sam Phippen).
352
+ * Make `expect(a).to be_within(x).percent_of(y)` work with negative y
353
+ (Katsuhiko Nishimra).
354
+ * Make the `be_predicate` matcher work as expected used with `expect{...}.to
355
+ change...` (Sam Phippen).
356
+
357
+ ### 2.14.0.rc1 / 2013-05-27
358
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.13.0...v2.14.0.rc1)
359
+
360
+ Enhancements
361
+
362
+ * Enhance `yield_control` so that you can specify an exact or relative
363
+ number of times: `expect { }.to yield_control.exactly(3).times`,
364
+ `expect { }.to yield_control.at_least(2).times`, etc (Bartek
365
+ Borkowski).
366
+ * Make the differ that is used when an expectation fails better handle arrays
367
+ by splitting each element of the array onto its own line. (Sam Phippen)
368
+ * Accept duck-typed strings that respond to `:to_str` as expectation messages.
369
+ (Toby Ovod-Everett)
370
+
371
+ Bug fixes
372
+
373
+ * Fix differ to not raise errors when dealing with differently-encoded
374
+ strings (Jon Rowe).
375
+ * Fix `expect(something).to be_within(x).percent_of(y)` where x and y are both
376
+ integers (Sam Phippen).
377
+ * Fix `have` matcher to handle the fact that on ruby 2.0,
378
+ `Enumerator#size` may return nil (Kenta Murata).
379
+ * Fix `expect { raise s }.to raise_error(s)` where s is an error instance
380
+ on ruby 2.0 (Sam Phippen).
381
+ * Fix `expect(object).to raise_error` passing. This now warns the user and
382
+ fails the spec (tomykaira).
383
+
384
+ Deprecations
385
+
386
+ * Deprecate `expect { }.not_to raise_error(SpecificErrorClass)` or
387
+ `expect { }.not_to raise_error("some specific message")`. Using
388
+ these was prone to hiding failures as they would allow _any other
389
+ error_ to pass. (Sam Phippen and David Chelimsky)
390
+
1
391
  ### 2.13.0 / 2013-02-23
2
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
392
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
3
393
 
4
394
  Enhancements
5
395
 
@@ -30,7 +420,7 @@ Bug fixes
30
420
  printed for empty diffs (Myron Marston).
31
421
 
32
422
  ### 2.12.1 / 2012-12-15
33
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
423
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
34
424
 
35
425
  Bug fixes
36
426
 
@@ -42,7 +432,7 @@ Bug fixes
42
432
  (Steven Harman)
43
433
 
44
434
  ### 2.12.0 / 2012-11-12
45
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...v2.12.0)
435
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...v2.12.0)
46
436
 
47
437
  Enhancements
48
438
 
@@ -65,7 +455,7 @@ Bug fixes
65
455
  (Tom Stuart)
66
456
 
67
457
  ### 2.11.3 / 2012-09-04
68
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
458
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
69
459
 
70
460
  Bug fixes
71
461
 
@@ -81,7 +471,7 @@ Bug fixes
81
471
  }.to change { user.last_emailed_at }.to be_within(1.second).of(Time.zone.now)
82
472
 
83
473
  ### 2.11.2 / 2012-07-25
84
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
474
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
85
475
 
86
476
  Bug fixes
87
477
 
@@ -90,7 +480,7 @@ Bug fixes
90
480
  of the object hierarchy. (Gabriel Gilder)
91
481
 
92
482
  ### 2.11.1 / 2012-07-08
93
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
483
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
94
484
 
95
485
  Bug fixes
96
486
 
@@ -99,7 +489,7 @@ Bug fixes
99
489
  * `Time`, for example, is a legit alternative.
100
490
 
101
491
  ### 2.11.0 / 2012-07-07
102
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
492
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
103
493
 
104
494
  Enhancements
105
495
 
@@ -122,7 +512,7 @@ Bug fixes
122
512
  Marston)
123
513
 
124
514
  ### 2.10.0 / 2012-05-03
125
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.1...v2.10.0)
515
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.1...v2.10.0)
126
516
 
127
517
  Enhancements
128
518
 
@@ -140,7 +530,7 @@ Bug fixes
140
530
  * Fix message-specific specs to pass on Rubinius (John Firebaugh)
141
531
 
142
532
  ### 2.9.1 / 2012-04-03
143
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...v2.9.1)
533
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...v2.9.1)
144
534
 
145
535
  Bug fixes
146
536
 
@@ -151,7 +541,7 @@ Bug fixes
151
541
  * Fix using execution context methods in nested DSL matchers (mirasrael)
152
542
 
153
543
  ### 2.9.0 / 2012-03-17
154
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
544
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
155
545
 
156
546
  Enhancements
157
547
 
@@ -171,7 +561,7 @@ Bug fixes
171
561
 
172
562
  ### 2.8.0 / 2012-01-04
173
563
 
174
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc2...v2.8.0)
564
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc2...v2.8.0)
175
565
 
176
566
  Enhancements
177
567
 
@@ -180,13 +570,13 @@ Enhancements
180
570
 
181
571
  ### 2.8.0.rc2 / 2011-12-19
182
572
 
183
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc1...v2.8.0.rc2)
573
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc1...v2.8.0.rc2)
184
574
 
185
575
  No changes for this release. Just releasing with the other rspec gems.
186
576
 
187
577
  ### 2.8.0.rc1 / 2011-11-06
188
578
 
189
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.7.0...v2.8.0.rc1)
579
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.7.0...v2.8.0.rc1)
190
580
 
191
581
  Enhancements
192
582
 
@@ -195,7 +585,7 @@ Enhancements
195
585
 
196
586
  ### 2.7.0 / 2011-10-16
197
587
 
198
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.6.0...v2.7.0)
588
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.6.0...v2.7.0)
199
589
 
200
590
  Enhancements
201
591
 
@@ -213,7 +603,7 @@ Bug fixes
213
603
 
214
604
  ### 2.6.0 / 2011-05-12
215
605
 
216
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.5.0...v2.6.0)
606
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.5.0...v2.6.0)
217
607
 
218
608
  Enhancements
219
609
 
@@ -231,7 +621,7 @@ Bug fixes
231
621
 
232
622
  ### 2.5.0 / 2011-02-05
233
623
 
234
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.4.0...v2.5.0)
624
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.4.0...v2.5.0)
235
625
 
236
626
  Enhancements
237
627
 
@@ -244,7 +634,7 @@ Documentation
244
634
 
245
635
  ### 2.4.0 / 2011-01-02
246
636
 
247
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.3.0...v2.4.0)
637
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.3.0...v2.4.0)
248
638
 
249
639
  No functional changes in this release, which was made to align with the
250
640
  rspec-core-2.4.0 release.
@@ -255,7 +645,7 @@ Enhancements
255
645
 
256
646
  ### 2.3.0 / 2010-12-12
257
647
 
258
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.2.1...v2.3.0)
648
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.2.1...v2.3.0)
259
649
 
260
650
  Enhancements
261
651
 
@@ -263,11 +653,11 @@ Enhancements
263
653
 
264
654
  ### 2.2.0 / 2010-11-28
265
655
 
266
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.1.0...v2.2.0)
656
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.1.0...v2.2.0)
267
657
 
268
658
  ### 2.1.0 / 2010-11-07
269
659
 
270
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.1...v2.1.0)
660
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.1...v2.1.0)
271
661
 
272
662
  Enhancements
273
663
 
@@ -286,7 +676,7 @@ Bug fixes
286
676
 
287
677
  ### 2.0.0 / 2010-10-10
288
678
 
289
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.rc...v2.0.0)
679
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.rc...v2.0.0)
290
680
 
291
681
  Enhancements
292
682
 
@@ -301,7 +691,7 @@ Bug fixes
301
691
 
302
692
  ### 2.0.0.rc / 2010-10-05
303
693
 
304
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.22...v2.0.0.rc)
694
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.22...v2.0.0.rc)
305
695
 
306
696
  Enhancements
307
697
 
@@ -314,7 +704,7 @@ Bug fixes
314
704
 
315
705
  ### 2.0.0.beta.22 / 2010-09-12
316
706
 
317
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.20...v2.0.0.beta.22)
707
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.20...v2.0.0.beta.22)
318
708
 
319
709
  Enhancements
320
710
 
data/License.txt CHANGED
@@ -1,5 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
+ Copyright (c) 2012 David Chelimsky, Myron Marston
3
4
  Copyright (c) 2006 David Chelimsky, The RSpec Development Team
4
5
  Copyright (c) 2005 Steven Baker
5
6