rspec-expectations 3.0.0.beta2 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +2 -2
  4. data/.yardopts +0 -1
  5. data/Changelog.md +115 -35
  6. data/README.md +2 -2
  7. data/lib/rspec/expectations.rb +13 -8
  8. data/lib/rspec/{matchers → expectations}/configuration.rb +38 -13
  9. data/lib/rspec/expectations/expectation_target.rb +72 -8
  10. data/lib/rspec/expectations/fail_with.rb +10 -52
  11. data/lib/rspec/expectations/handler.rb +9 -11
  12. data/lib/rspec/expectations/syntax.rb +37 -35
  13. data/lib/rspec/expectations/version.rb +1 -1
  14. data/lib/rspec/matchers.rb +60 -9
  15. data/lib/rspec/matchers/aliased_matcher.rb +6 -0
  16. data/lib/rspec/matchers/built_in.rb +9 -1
  17. data/lib/rspec/matchers/built_in/all.rb +78 -0
  18. data/lib/rspec/matchers/built_in/base_matcher.rb +39 -1
  19. data/lib/rspec/matchers/built_in/be.rb +117 -42
  20. data/lib/rspec/matchers/built_in/be_between.rb +22 -0
  21. data/lib/rspec/matchers/built_in/be_instance_of.rb +11 -3
  22. data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -0
  23. data/lib/rspec/matchers/built_in/be_within.rb +26 -6
  24. data/lib/rspec/matchers/built_in/change.rb +89 -13
  25. data/lib/rspec/matchers/built_in/compound.rb +19 -3
  26. data/lib/rspec/matchers/built_in/contain_exactly.rb +17 -6
  27. data/lib/rspec/matchers/built_in/cover.rb +3 -0
  28. data/lib/rspec/matchers/built_in/eq.rb +20 -5
  29. data/lib/rspec/matchers/built_in/eql.rb +15 -3
  30. data/lib/rspec/matchers/built_in/equal.rb +23 -6
  31. data/lib/rspec/matchers/built_in/exist.rb +74 -10
  32. data/lib/rspec/matchers/built_in/has.rb +58 -3
  33. data/lib/rspec/matchers/built_in/include.rb +16 -1
  34. data/lib/rspec/matchers/built_in/match.rb +14 -4
  35. data/lib/rspec/matchers/built_in/operators.rb +16 -0
  36. data/lib/rspec/matchers/built_in/output.rb +47 -5
  37. data/lib/rspec/matchers/built_in/raise_error.rb +40 -23
  38. data/lib/rspec/matchers/built_in/respond_to.rb +37 -16
  39. data/lib/rspec/matchers/built_in/satisfy.rb +15 -0
  40. data/lib/rspec/matchers/built_in/start_and_end_with.rb +29 -14
  41. data/lib/rspec/matchers/built_in/throw_symbol.rb +32 -3
  42. data/lib/rspec/matchers/built_in/yield.rb +148 -44
  43. data/lib/rspec/matchers/composable.rb +48 -7
  44. data/lib/rspec/matchers/dsl.rb +45 -17
  45. data/lib/rspec/matchers/generated_descriptions.rb +7 -0
  46. data/lib/rspec/matchers/matcher_delegator.rb +6 -2
  47. data/lib/rspec/matchers/pretty.rb +15 -19
  48. metadata +33 -236
  49. metadata.gz.sig +0 -0
  50. data/features/README.md +0 -48
  51. data/features/Upgrade.md +0 -53
  52. data/features/built_in_matchers/README.md +0 -96
  53. data/features/built_in_matchers/be.feature +0 -175
  54. data/features/built_in_matchers/be_within.feature +0 -48
  55. data/features/built_in_matchers/comparisons.feature +0 -97
  56. data/features/built_in_matchers/contain_exactly.feature +0 -46
  57. data/features/built_in_matchers/cover.feature +0 -47
  58. data/features/built_in_matchers/end_with.feature +0 -48
  59. data/features/built_in_matchers/equality.feature +0 -136
  60. data/features/built_in_matchers/exist.feature +0 -45
  61. data/features/built_in_matchers/expect_change.feature +0 -59
  62. data/features/built_in_matchers/expect_error.feature +0 -144
  63. data/features/built_in_matchers/include.feature +0 -126
  64. data/features/built_in_matchers/match.feature +0 -51
  65. data/features/built_in_matchers/output.feature +0 -70
  66. data/features/built_in_matchers/predicates.feature +0 -161
  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 -161
  73. data/features/composing_matchers.feature +0 -250
  74. data/features/compound_expectations.feature +0 -45
  75. data/features/custom_matchers/access_running_example.feature +0 -53
  76. data/features/custom_matchers/define_diffable_matcher.feature +0 -27
  77. data/features/custom_matchers/define_matcher.feature +0 -340
  78. data/features/custom_matchers/define_matcher_outside_rspec.feature +0 -34
  79. data/features/custom_matchers/define_matcher_with_fluent_interface.feature +0 -24
  80. data/features/customized_message.feature +0 -39
  81. data/features/diffing.feature +0 -85
  82. data/features/implicit_docstrings.feature +0 -52
  83. data/features/step_definitions/additional_cli_steps.rb +0 -22
  84. data/features/support/env.rb +0 -21
  85. data/features/support/rubinius.rb +0 -6
  86. data/features/syntax_configuration.feature +0 -71
  87. data/features/test_frameworks/minitest.feature +0 -44
  88. data/lib/rspec-expectations.rb +0 -1
  89. data/lib/rspec/expectations/diff_presenter.rb +0 -141
  90. data/lib/rspec/expectations/differ.rb +0 -44
  91. data/lib/rspec/expectations/encoded_string.rb +0 -56
  92. data/spec/rspec/expectations/diff_presenter_spec.rb +0 -249
  93. data/spec/rspec/expectations/encoded_string_spec.rb +0 -74
  94. data/spec/rspec/expectations/expectation_target_spec.rb +0 -82
  95. data/spec/rspec/expectations/extensions/kernel_spec.rb +0 -67
  96. data/spec/rspec/expectations/fail_with_spec.rb +0 -114
  97. data/spec/rspec/expectations/handler_spec.rb +0 -205
  98. data/spec/rspec/expectations/minitest_integration_spec.rb +0 -27
  99. data/spec/rspec/expectations/syntax_spec.rb +0 -89
  100. data/spec/rspec/expectations_spec.rb +0 -12
  101. data/spec/rspec/matchers/aliased_matcher_spec.rb +0 -48
  102. data/spec/rspec/matchers/aliases_spec.rb +0 -449
  103. data/spec/rspec/matchers/built_in/base_matcher_spec.rb +0 -83
  104. data/spec/rspec/matchers/built_in/be_between_spec.rb +0 -159
  105. data/spec/rspec/matchers/built_in/be_instance_of_spec.rb +0 -63
  106. data/spec/rspec/matchers/built_in/be_kind_of_spec.rb +0 -41
  107. data/spec/rspec/matchers/built_in/be_spec.rb +0 -592
  108. data/spec/rspec/matchers/built_in/be_within_spec.rb +0 -141
  109. data/spec/rspec/matchers/built_in/change_spec.rb +0 -808
  110. data/spec/rspec/matchers/built_in/compound_spec.rb +0 -292
  111. data/spec/rspec/matchers/built_in/contain_exactly_spec.rb +0 -441
  112. data/spec/rspec/matchers/built_in/cover_spec.rb +0 -69
  113. data/spec/rspec/matchers/built_in/eq_spec.rb +0 -156
  114. data/spec/rspec/matchers/built_in/eql_spec.rb +0 -41
  115. data/spec/rspec/matchers/built_in/equal_spec.rb +0 -106
  116. data/spec/rspec/matchers/built_in/exist_spec.rb +0 -124
  117. data/spec/rspec/matchers/built_in/has_spec.rb +0 -161
  118. data/spec/rspec/matchers/built_in/include_spec.rb +0 -540
  119. data/spec/rspec/matchers/built_in/match_spec.rb +0 -102
  120. data/spec/rspec/matchers/built_in/operators_spec.rb +0 -252
  121. data/spec/rspec/matchers/built_in/output_spec.rb +0 -165
  122. data/spec/rspec/matchers/built_in/raise_error_spec.rb +0 -461
  123. data/spec/rspec/matchers/built_in/respond_to_spec.rb +0 -292
  124. data/spec/rspec/matchers/built_in/satisfy_spec.rb +0 -44
  125. data/spec/rspec/matchers/built_in/start_and_end_with_spec.rb +0 -253
  126. data/spec/rspec/matchers/built_in/throw_symbol_spec.rb +0 -135
  127. data/spec/rspec/matchers/built_in/yield_spec.rb +0 -627
  128. data/spec/rspec/matchers/configuration_spec.rb +0 -213
  129. data/spec/rspec/matchers/description_generation_spec.rb +0 -191
  130. data/spec/rspec/matchers/dsl_spec.rb +0 -895
  131. data/spec/rspec/matchers/legacy_spec.rb +0 -101
  132. data/spec/rspec/matchers_spec.rb +0 -74
  133. data/spec/spec_helper.rb +0 -85
  134. data/spec/support/matchers.rb +0 -22
  135. data/spec/support/shared_examples.rb +0 -35
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0181be4602ed4ac6d670697bf344c87c7bd3fcdc
4
+ data.tar.gz: ee3893dbfb862139c0e12c360f48dc760cb922bf
5
+ SHA512:
6
+ metadata.gz: 3c2f98cd09341e83b60ec9a38bb39ba498709d185e33317781aea4a9e71f68627edc71e7a4c9afdcde4c116342fd105d40f2b06e9d128c4007b0f86e1aa5f6df
7
+ data.tar.gz: 58b7301b5efff34a38ee382943b0ffff5dcfc4eb9f1070ee41fa7da56a8234fa61c61bde87359ed69ef14cf460d67b4a798a7fd82adcb6e4072c0353af1feb4b
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- b��y�8W����O~����(���^WK� "ڴj�z\�fF�~���0"�6��KSV�v/�t��K�rz[x�� (�����n�BA?L�.=R���O}l=D�8�.��dI��S���~�� 4�Y����A+�����8��`��H�W� �Oh"k���D�_�
2
- _���{0�]��e��Ƭj����*Pz@�docLtt���C�;��F(J����6���<7�v�Xrgmi��I�-�B0
1
+ �X�Z�м�q��j��?�� p*�P5n2j�z)���6�Ǧ�@��3��
2
+ %�xȥ~��j��Js��Vw��KN\%6cʑĠ�7N0��5�ad�Q��f}Ƚ�BTE��<)�\�3�Z������,�X8l��/����� tɅV�#��p2l�pn��:���nR�-_�v�/2�?��m ����/@��\�nW٪�S�����G ���4l\5}�˅'�{�I|�[�ٯx9(�D
data/.yardopts CHANGED
@@ -1,4 +1,3 @@
1
- --load ./yard/alias_matcher.rb
2
1
  --exclude features
3
2
  --no-private
4
3
  --markup markdown
@@ -1,5 +1,62 @@
1
+ ### 3.0.0.rc1 / 2014-05-18
2
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.beta2...v3.0.0.rc1)
3
+
4
+ Breaking Changes for 3.0.0:
5
+
6
+ * Remove `matcher_execution_context` attribute from DSL-defined
7
+ custom matchers. (Myron Marston)
8
+ * Remove `RSpec::Matchers::Pretty#_pretty_print`. (Myron Marston)
9
+ * Remove `RSpec::Matchers::Pretty#expected_to_sentence`. (Myron Marston)
10
+ * Rename `RSpec::Matchers::Configuration` constant to
11
+ `RSpec::Expectations::Configuration`. (Myron Marston)
12
+ * Prevent `have_xyz` predicate matchers using private methods.
13
+ (Adrian Gonzalez)
14
+ * Block matchers must now implement `supports_block_expectations?`.
15
+ (Myron Marston)
16
+ * Stop supporting `require 'rspec-expectations'`.
17
+ Use `require 'rspec/expectations'` instead. (Myron Marston)
18
+
19
+ Bug Fixes:
20
+
21
+ * Fix `NoMethodError` triggered by beta2 when `YARD` was loaded in
22
+ the test environment. (Myron Marston)
23
+ * Fix `be_xyz` matcher to accept a `do...end` block. (Myron Marston)
24
+ * Fix composable matcher failure message generation logic
25
+ so that it does not blow up when given `$stdout` or `$stderr`.
26
+ (Myron Marston)
27
+ * Fix `change` matcher to work properly with `IO` objects.
28
+ (Myron Marston)
29
+ * Fix `exist` matcher so that it can be used in composed matcher
30
+ expressions involving objects that do not implement `exist?` or
31
+ `exists?`. (Daniel Fone)
32
+ * Fix composable matcher match logic so that it clones matchers
33
+ before using them in order to work properly with matchers
34
+ that use internal memoization based on a given `actual` value.
35
+ (Myron Marston)
36
+ * Fix `be_xyz` and `has_xyz` predicate matchers so that they can
37
+ be used in composed matcher expressions involving objects that
38
+ do not implement the predicate method. (Daniel Fone)
39
+
40
+ Enhancements:
41
+
42
+ * Document the remaining public APIs. rspec-expectations now has 100% of
43
+ the public API documented and will remain that way (as new undocumented
44
+ methods will fail the build). (Myron Marston)
45
+ * Improve the formatting of BigDecimal objects in `eq` matcher failure
46
+ messages. (Daniel Fone)
47
+ * Improve the failure message for `be_xyz` predicate matchers so
48
+ that it includes the `inspect` output of the receiver.
49
+ (Erik Michaels-Ober, Sam Phippen)
50
+ * Add `all` matcher, to allow you to specify that a given matcher
51
+ matches all elements in a collection:
52
+ `expect([1, 3, 5]).to all( be_odd )`. (Adam Farhi)
53
+ * Add boolean aliases (`&`/`|`) for compound operators (`and`/`or`). (Adam Farhi)
54
+ * Give users a clear error when they wrongly use a value matcher
55
+ in a block expectation expression (e.g. `expect { 3 }.to eq(3)`)
56
+ or vice versa. (Myron Marston)
57
+
1
58
  ### 3.0.0.beta2 / 2014-02-17
2
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.beta1...v3.0.0.beta2)
59
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.0.0.beta1...v3.0.0.beta2)
3
60
 
4
61
  Breaking Changes for 3.0.0:
5
62
 
@@ -97,7 +154,7 @@ Deprecations:
97
154
  a deprecation warning. (Myron Marston)
98
155
 
99
156
  ### 3.0.0.beta1 / 2013-11-07
100
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta1...v3.0.0.beta1)
157
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.rc1...v3.0.0.beta1)
101
158
 
102
159
  Breaking Changes for 3.0.0:
103
160
 
@@ -119,7 +176,7 @@ Breaking Changes for 3.0.0:
119
176
  available to the `match` block (or any of the others). Instead
120
177
  `include` your helper module and define the helper method as an
121
178
  instance method. (Myron Marston)
122
- * Force upgrading Diff::LCS for encoding compatbility with diffs. (Jon Rowe)
179
+ * Force upgrading Diff::LCS for encoding compatability with diffs. (Jon Rowe)
123
180
 
124
181
  Enhancements:
125
182
 
@@ -145,8 +202,31 @@ Deprecations:
145
202
  It will continue to work but will emit a deprecation warning in RSpec 3 if
146
203
  you do not explicitly enable it. (Sam Phippen)
147
204
 
205
+ ### 2.99.0.rc1 / 2014-05-18
206
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta2...2.99.0.rc1)
207
+
208
+ Deprecations:
209
+
210
+ * Deprecate `matcher_execution_context` attribute on DSL-defined
211
+ custom matchers. (Myron Marston)
212
+ * Deprecate `RSpec::Matchers::Pretty#_pretty_print`. (Myron Marston)
213
+ * Deprecate `RSpec::Matchers::Pretty#expected_to_sentence`. (Myron Marston)
214
+ * Deprecate `RSpec::Matchers::Configuration` in favor of
215
+ `RSpec::Expectations::Configuration`. (Myron Marston)
216
+ * Deprecate `be_xyz` predicate matcher on an object that doesn't respond to
217
+ `xyz?` or `xyzs?`. (Daniel Fone)
218
+ * Deprecate `have_xyz` matcher on an object that doesn't respond to `has_xyz?`.
219
+ (Daniel Fone)
220
+ * Deprecate `have_xyz` matcher on an object that has a private method `has_xyz?`.
221
+ (Jon Rowe)
222
+ * Issue a deprecation warning when a block expectation expression is
223
+ used with a matcher that doesn't explicitly support block expectations
224
+ via `supports_block_expectations?`. (Myron Marston)
225
+ * Deprecate `require 'rspec-expectations'`. Use
226
+ `require 'rspec/expectations'` instead. (Myron Marston)
227
+
148
228
  ### 2.99.0.beta2 / 2014-02-17
149
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta1...v2.99.0.beta2)
229
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.99.0.beta1...v2.99.0.beta2)
150
230
 
151
231
  Deprecations:
152
232
 
@@ -172,7 +252,7 @@ Deprecations:
172
252
  work properly. (Jon Rowe)
173
253
 
174
254
  ### 2.99.0.beta1 / 2013-11-07
175
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.99.0.beta1)
255
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.99.0.beta1)
176
256
 
177
257
  Deprecations
178
258
 
@@ -197,7 +277,7 @@ Deprecations
197
277
  either purpose, but RSpec 3.0 will not.
198
278
 
199
279
  ### 2.14.5 / 2014-02-01
200
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.14.5)
280
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.4...v2.14.5)
201
281
 
202
282
  Bug fixes
203
283
 
@@ -205,7 +285,7 @@ Bug fixes
205
285
  (yujinakayama)
206
286
 
207
287
  ### 2.14.4 / 2013-11-06
208
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.3...v2.14.4)
288
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.3...v2.14.4)
209
289
 
210
290
  Bug fixes
211
291
 
@@ -214,7 +294,7 @@ Bug fixes
214
294
  back to default internal encoding with replacing characters. (Jon Rowe)
215
295
 
216
296
  ### 2.14.3 / 2013-09-22
217
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.2...v2.14.3)
297
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.2...v2.14.3)
218
298
 
219
299
  Bug fixes
220
300
 
@@ -225,7 +305,7 @@ Bug fixes
225
305
  `method_missing` (Jon Rowe)
226
306
 
227
307
  ### 2.14.2 / 2013-08-14
228
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.1...v2.14.2)
308
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.1...v2.14.2)
229
309
 
230
310
  Bug fixes
231
311
 
@@ -241,7 +321,7 @@ Bug fixes
241
321
  `SomeClass === SomeClass` returns false. (Myron Marston)
242
322
 
243
323
  ### 2.14.1 / 2013-08-08
244
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0...2.14.1)
324
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0...2.14.1)
245
325
 
246
326
  Bug fixes
247
327
 
@@ -250,7 +330,7 @@ Bug fixes
250
330
  errors (Jon Rowe).
251
331
 
252
332
  ### 2.14.0 / 2013-07-06
253
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0.rc1...v2.14.0)
333
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0.rc1...v2.14.0)
254
334
 
255
335
  Bug fixes
256
336
 
@@ -262,7 +342,7 @@ Bug fixes
262
342
  change...` (Sam Phippen).
263
343
 
264
344
  ### 2.14.0.rc1 / 2013-05-27
265
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.13.0...v2.14.0.rc1)
345
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.13.0...v2.14.0.rc1)
266
346
 
267
347
  Enhancements
268
348
 
@@ -296,7 +376,7 @@ Deprecations
296
376
  error_ to pass. (Sam Phippen and David Chelimsky)
297
377
 
298
378
  ### 2.13.0 / 2013-02-23
299
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
379
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
300
380
 
301
381
  Enhancements
302
382
 
@@ -327,7 +407,7 @@ Bug fixes
327
407
  printed for empty diffs (Myron Marston).
328
408
 
329
409
  ### 2.12.1 / 2012-12-15
330
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
410
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
331
411
 
332
412
  Bug fixes
333
413
 
@@ -339,7 +419,7 @@ Bug fixes
339
419
  (Steven Harman)
340
420
 
341
421
  ### 2.12.0 / 2012-11-12
342
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...v2.12.0)
422
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...v2.12.0)
343
423
 
344
424
  Enhancements
345
425
 
@@ -362,7 +442,7 @@ Bug fixes
362
442
  (Tom Stuart)
363
443
 
364
444
  ### 2.11.3 / 2012-09-04
365
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
445
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
366
446
 
367
447
  Bug fixes
368
448
 
@@ -378,7 +458,7 @@ Bug fixes
378
458
  }.to change { user.last_emailed_at }.to be_within(1.second).of(Time.zone.now)
379
459
 
380
460
  ### 2.11.2 / 2012-07-25
381
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
461
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
382
462
 
383
463
  Bug fixes
384
464
 
@@ -387,7 +467,7 @@ Bug fixes
387
467
  of the object hierarchy. (Gabriel Gilder)
388
468
 
389
469
  ### 2.11.1 / 2012-07-08
390
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
470
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
391
471
 
392
472
  Bug fixes
393
473
 
@@ -396,7 +476,7 @@ Bug fixes
396
476
  * `Time`, for example, is a legit alternative.
397
477
 
398
478
  ### 2.11.0 / 2012-07-07
399
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
479
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
400
480
 
401
481
  Enhancements
402
482
 
@@ -419,7 +499,7 @@ Bug fixes
419
499
  Marston)
420
500
 
421
501
  ### 2.10.0 / 2012-05-03
422
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.1...v2.10.0)
502
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.1...v2.10.0)
423
503
 
424
504
  Enhancements
425
505
 
@@ -437,7 +517,7 @@ Bug fixes
437
517
  * Fix message-specific specs to pass on Rubinius (John Firebaugh)
438
518
 
439
519
  ### 2.9.1 / 2012-04-03
440
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...v2.9.1)
520
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...v2.9.1)
441
521
 
442
522
  Bug fixes
443
523
 
@@ -448,7 +528,7 @@ Bug fixes
448
528
  * Fix using execution context methods in nested DSL matchers (mirasrael)
449
529
 
450
530
  ### 2.9.0 / 2012-03-17
451
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
531
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
452
532
 
453
533
  Enhancements
454
534
 
@@ -468,7 +548,7 @@ Bug fixes
468
548
 
469
549
  ### 2.8.0 / 2012-01-04
470
550
 
471
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc2...v2.8.0)
551
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc2...v2.8.0)
472
552
 
473
553
  Enhancements
474
554
 
@@ -477,13 +557,13 @@ Enhancements
477
557
 
478
558
  ### 2.8.0.rc2 / 2011-12-19
479
559
 
480
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc1...v2.8.0.rc2)
560
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0.rc1...v2.8.0.rc2)
481
561
 
482
562
  No changes for this release. Just releasing with the other rspec gems.
483
563
 
484
564
  ### 2.8.0.rc1 / 2011-11-06
485
565
 
486
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.7.0...v2.8.0.rc1)
566
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.7.0...v2.8.0.rc1)
487
567
 
488
568
  Enhancements
489
569
 
@@ -492,7 +572,7 @@ Enhancements
492
572
 
493
573
  ### 2.7.0 / 2011-10-16
494
574
 
495
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.6.0...v2.7.0)
575
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.6.0...v2.7.0)
496
576
 
497
577
  Enhancements
498
578
 
@@ -510,7 +590,7 @@ Bug fixes
510
590
 
511
591
  ### 2.6.0 / 2011-05-12
512
592
 
513
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.5.0...v2.6.0)
593
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.5.0...v2.6.0)
514
594
 
515
595
  Enhancements
516
596
 
@@ -528,7 +608,7 @@ Bug fixes
528
608
 
529
609
  ### 2.5.0 / 2011-02-05
530
610
 
531
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.4.0...v2.5.0)
611
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.4.0...v2.5.0)
532
612
 
533
613
  Enhancements
534
614
 
@@ -541,7 +621,7 @@ Documentation
541
621
 
542
622
  ### 2.4.0 / 2011-01-02
543
623
 
544
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.3.0...v2.4.0)
624
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.3.0...v2.4.0)
545
625
 
546
626
  No functional changes in this release, which was made to align with the
547
627
  rspec-core-2.4.0 release.
@@ -552,7 +632,7 @@ Enhancements
552
632
 
553
633
  ### 2.3.0 / 2010-12-12
554
634
 
555
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.2.1...v2.3.0)
635
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.2.1...v2.3.0)
556
636
 
557
637
  Enhancements
558
638
 
@@ -560,11 +640,11 @@ Enhancements
560
640
 
561
641
  ### 2.2.0 / 2010-11-28
562
642
 
563
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.1.0...v2.2.0)
643
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.1.0...v2.2.0)
564
644
 
565
645
  ### 2.1.0 / 2010-11-07
566
646
 
567
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.1...v2.1.0)
647
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.1...v2.1.0)
568
648
 
569
649
  Enhancements
570
650
 
@@ -583,7 +663,7 @@ Bug fixes
583
663
 
584
664
  ### 2.0.0 / 2010-10-10
585
665
 
586
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.rc...v2.0.0)
666
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.rc...v2.0.0)
587
667
 
588
668
  Enhancements
589
669
 
@@ -598,7 +678,7 @@ Bug fixes
598
678
 
599
679
  ### 2.0.0.rc / 2010-10-05
600
680
 
601
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.22...v2.0.0.rc)
681
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.22...v2.0.0.rc)
602
682
 
603
683
  Enhancements
604
684
 
@@ -611,7 +691,7 @@ Bug fixes
611
691
 
612
692
  ### 2.0.0.beta.22 / 2010-09-12
613
693
 
614
- [full changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.20...v2.0.0.beta.22)
694
+ [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v2.0.0.beta.20...v2.0.0.beta.22)
615
695
 
616
696
  Enhancements
617
697
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RSpec Expectations [![Build Status](https://secure.travis-ci.org/rspec/rspec-expectations.png?branch=master)](http://travis-ci.org/rspec/rspec-expectations) [![Code Climate](https://codeclimate.com/github/rspec/rspec-expectations.png)](https://codeclimate.com/github/rspec/rspec-expectations)
1
+ # RSpec Expectations [![Build Status](https://secure.travis-ci.org/rspec/rspec-expectations.png?branch=master)](http://travis-ci.org/rspec/rspec-expectations) [![Code Climate](https://codeclimate.com/github/rspec/rspec-expectations.png)](https://codeclimate.com/github/rspec/rspec-expectations) [![Inline docs](http://inch-pages.github.io/github/rspec/rspec-expectations.png)](http://inch-pages.github.io/github/rspec/rspec-expectations)
2
2
 
3
3
  RSpec::Expectations lets you express expected outcomes on an object in an
4
4
  example.
@@ -23,7 +23,7 @@ Minitest, or Cucumber, you can install it directly:
23
23
  Here's an example using rspec-core:
24
24
 
25
25
  ```ruby
26
- describe Order do
26
+ RSpec.describe Order do
27
27
  it "sums the prices of the items in its line items" do
28
28
  order = Order.new
29
29
  order.add_entry(LineItem.new(:item => Item.new(
@@ -1,13 +1,18 @@
1
- require 'rspec/support/caller_filter'
2
- require 'rspec/support/warnings'
1
+ require 'rspec/support'
2
+ RSpec::Support.require_rspec_support "caller_filter"
3
+ RSpec::Support.require_rspec_support "warnings"
3
4
 
4
5
  require 'rspec/matchers'
5
- require 'rspec/expectations/expectation_target'
6
- require 'rspec/matchers/configuration'
7
- require 'rspec/expectations/fail_with'
8
- require 'rspec/expectations/handler'
9
- require 'rspec/expectations/version'
10
- require 'rspec/expectations/diff_presenter'
6
+
7
+ RSpec::Support.define_optimized_require_for_rspec(:expectations) { |f| require_relative(f) }
8
+
9
+ %w[
10
+ expectation_target
11
+ configuration
12
+ fail_with
13
+ handler
14
+ version
15
+ ].each { |file| RSpec::Support.require_rspec_expectations(file) }
11
16
 
12
17
  module RSpec
13
18
  # RSpec::Expectations provides a simple, readable API to express
@@ -1,8 +1,22 @@
1
- require 'rspec/expectations/syntax'
1
+ RSpec::Support.require_rspec_expectations "syntax"
2
2
 
3
3
  module RSpec
4
- module Matchers
4
+ module Expectations
5
5
  # Provides configuration options for rspec-expectations.
6
+ # If you are using rspec-core, you can access this via a
7
+ # block passed to `RSpec::Core::Configuration#expect_with`.
8
+ # Otherwise, you can access it via RSpec::Expectations.configuration.
9
+ #
10
+ # @example
11
+ # RSpec.configure do |rspec|
12
+ # rspec.expect_with :rspec do |c|
13
+ # # c is the config object
14
+ # end
15
+ # end
16
+ #
17
+ # # or
18
+ #
19
+ # RSpec::Expectations.configuration
6
20
  class Configuration
7
21
  # Configures the supported syntax.
8
22
  # @param [Array<Symbol>, Symbol] values the syntaxes to enable
@@ -32,6 +46,10 @@ module RSpec
32
46
 
33
47
  # The list of configured syntaxes.
34
48
  # @return [Array<Symbol>] the list of configured syntaxes.
49
+ # @example
50
+ # unless RSpec::Matchers.configuration.syntax.include?(:expect)
51
+ # raise "this RSpec extension gem requires the rspec-expectations `:expect` syntax"
52
+ # end
35
53
  def syntax
36
54
  syntaxes = []
37
55
  syntaxes << :should if Expectations::Syntax.should_enabled?
@@ -39,14 +57,21 @@ module RSpec
39
57
  syntaxes
40
58
  end
41
59
 
42
- # color config for expectations
43
- # fallback if rspec core not available
44
60
  if ::RSpec.respond_to?(:configuration)
45
61
  def color?
46
62
  ::RSpec.configuration.color_enabled?
47
63
  end
48
64
  else
49
- attr_writer :color
65
+ # Indicates whether or not diffs should be colored.
66
+ # Delegates to rspec-core's color option if rspec-core
67
+ # is loaded; otherwise you can set it here.
68
+ def color=(value)
69
+ @color = value
70
+ end
71
+
72
+ # Indicates whether or not diffs should be colored.
73
+ # Delegates to rspec-core's color option if rspec-core
74
+ # is loaded; otherwise you can set it here.
50
75
  def color?
51
76
  @color
52
77
  end
@@ -74,25 +99,25 @@ module RSpec
74
99
  # will be used (including respecting the presence or absence of
75
100
  # the `--backtrace` option).
76
101
  #
77
- # @overload backtrace_formatter
78
- # @return [#format_backtrace] the backtrace formatter
79
- # @overload backtrace_formatter=
80
- # @param value [#format_backtrace] sets the backtrace formatter
102
+ # @!attribute [rw] backtrace_formatter
81
103
  attr_writer :backtrace_formatter
82
104
  def backtrace_formatter
83
- @backtrace_formatter ||= if defined?(::RSpec::Core::BacktraceFormatter)
84
- ::RSpec::Core::BacktraceFormatter
105
+ @backtrace_formatter ||= if defined?(::RSpec.configuration.backtrace_formatter)
106
+ ::RSpec.configuration.backtrace_formatter
85
107
  else
86
108
  NullBacktraceFormatter
87
109
  end
88
110
  end
89
111
 
112
+ # @private
90
113
  def reset_syntaxes_to_default
91
114
  self.syntax = [:should, :expect]
92
115
  RSpec::Expectations::Syntax.warn_about_should!
93
116
  end
94
117
 
95
118
  # @api private
119
+ # Null implementation of a backtrace formatter used by default
120
+ # when rspec-core is not loaded. Does no filtering.
96
121
  NullBacktraceFormatter = Module.new do
97
122
  def self.format_backtrace(backtrace)
98
123
  backtrace
@@ -100,8 +125,8 @@ module RSpec
100
125
  end
101
126
  end
102
127
 
103
- # The configuration object
104
- # @return [RSpec::Matchers::Configuration] the configuration object
128
+ # The configuration object.
129
+ # @return [RSpec::Expectations::Configuration] the configuration object
105
130
  def self.configuration
106
131
  @configuration ||= Configuration.new
107
132
  end