rspec-core 2.99.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 (216) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.sig +0 -0
  3. data/.yardopts +1 -0
  4. data/Changelog.md +339 -1
  5. data/License.txt +1 -0
  6. data/README.md +19 -37
  7. data/exe/rspec +2 -23
  8. data/lib/rspec/core/backport_random.rb +336 -0
  9. data/lib/rspec/core/backtrace_formatter.rb +70 -0
  10. data/lib/rspec/core/configuration.rb +479 -577
  11. data/lib/rspec/core/configuration_options.rb +71 -54
  12. data/lib/rspec/core/drb.rb +111 -0
  13. data/lib/rspec/core/dsl.rb +86 -18
  14. data/lib/rspec/core/example.rb +267 -119
  15. data/lib/rspec/core/example_group.rb +381 -393
  16. data/lib/rspec/core/filter_manager.rb +133 -114
  17. data/lib/rspec/core/flat_map.rb +18 -0
  18. data/lib/rspec/core/formatters/base_formatter.rb +51 -125
  19. data/lib/rspec/core/formatters/base_text_formatter.rb +34 -286
  20. data/lib/rspec/core/formatters/console_codes.rb +24 -1
  21. data/lib/rspec/core/formatters/deprecation_formatter.rb +25 -26
  22. data/lib/rspec/core/formatters/documentation_formatter.rb +27 -25
  23. data/lib/rspec/core/formatters/helpers.rb +14 -36
  24. data/lib/rspec/core/formatters/html_formatter.rb +58 -65
  25. data/lib/rspec/core/formatters/html_printer.rb +12 -18
  26. data/lib/rspec/core/formatters/json_formatter.rb +54 -31
  27. data/lib/rspec/core/formatters/profile_formatter.rb +67 -0
  28. data/lib/rspec/core/formatters/progress_formatter.rb +11 -15
  29. data/lib/rspec/core/formatters/snippet_extractor.rb +22 -11
  30. data/lib/rspec/core/formatters.rb +90 -43
  31. data/lib/rspec/core/hooks.rb +325 -270
  32. data/lib/rspec/core/memoized_helpers.rb +45 -156
  33. data/lib/rspec/core/metadata.rb +284 -236
  34. data/lib/rspec/core/metadata_filter.rb +86 -0
  35. data/lib/rspec/core/mocking_adapters/flexmock.rb +29 -0
  36. data/lib/rspec/core/{mocking/with_mocha.rb → mocking_adapters/mocha.rb} +19 -16
  37. data/lib/rspec/core/mocking_adapters/null.rb +12 -0
  38. data/lib/rspec/core/mocking_adapters/rr.rb +29 -0
  39. data/lib/rspec/core/mocking_adapters/rspec.rb +30 -0
  40. data/lib/rspec/core/notifications.rb +511 -0
  41. data/lib/rspec/core/option_parser.rb +49 -74
  42. data/lib/rspec/core/ordering.rb +156 -0
  43. data/lib/rspec/core/pending.rb +94 -96
  44. data/lib/rspec/core/project_initializer/.rspec +3 -0
  45. data/lib/rspec/core/project_initializer/spec/spec_helper.rb +78 -0
  46. data/lib/rspec/core/project_initializer.rb +24 -64
  47. data/lib/rspec/core/rake_task.rb +44 -130
  48. data/lib/rspec/core/reporter.rb +76 -59
  49. data/lib/rspec/core/ruby_project.rb +2 -1
  50. data/lib/rspec/core/runner.rb +117 -52
  51. data/lib/rspec/core/shared_context.rb +10 -10
  52. data/lib/rspec/core/shared_example_group.rb +108 -121
  53. data/lib/rspec/core/version.rb +3 -1
  54. data/lib/rspec/core/warnings.rb +40 -0
  55. data/lib/rspec/core/world.rb +66 -10
  56. data/lib/rspec/core.rb +64 -104
  57. data.tar.gz.sig +3 -0
  58. metadata +75 -322
  59. metadata.gz.sig +1 -0
  60. data/exe/autospec +0 -13
  61. data/features/Autotest.md +0 -38
  62. data/features/README.md +0 -17
  63. data/features/Upgrade.md +0 -364
  64. data/features/command_line/README.md +0 -28
  65. data/features/command_line/example_name_option.feature +0 -97
  66. data/features/command_line/exit_status.feature +0 -82
  67. data/features/command_line/format_option.feature +0 -75
  68. data/features/command_line/init.feature +0 -18
  69. data/features/command_line/line_number_appended_to_path.feature +0 -140
  70. data/features/command_line/line_number_option.feature +0 -53
  71. data/features/command_line/order.feature +0 -26
  72. data/features/command_line/pattern_option.feature +0 -49
  73. data/features/command_line/rake_task.feature +0 -122
  74. data/features/command_line/require_option.feature +0 -43
  75. data/features/command_line/ruby.feature +0 -22
  76. data/features/command_line/tag.feature +0 -98
  77. data/features/command_line/warnings_option.feature +0 -29
  78. data/features/configuration/alias_example_to.feature +0 -48
  79. data/features/configuration/backtrace_clean_patterns.feature +0 -102
  80. data/features/configuration/custom_settings.feature +0 -84
  81. data/features/configuration/default_path.feature +0 -38
  82. data/features/configuration/deprecation_stream.feature +0 -58
  83. data/features/configuration/fail_fast.feature +0 -77
  84. data/features/configuration/failure_exit_code.feature +0 -36
  85. data/features/configuration/order_and_seed.feature +0 -3
  86. data/features/configuration/output_stream.feature +0 -24
  87. data/features/configuration/pattern.feature +0 -38
  88. data/features/configuration/profile.feature +0 -220
  89. data/features/configuration/read_options_from_file.feature +0 -90
  90. data/features/configuration/run_all_when_everything_filtered.feature +0 -76
  91. data/features/configuration/show_failures_in_pending_blocks.feature +0 -61
  92. data/features/configuration/treat_symbols_as_metadata_keys_with_true_values.feature +0 -52
  93. data/features/example_groups/basic_structure.feature +0 -55
  94. data/features/example_groups/shared_context.feature +0 -74
  95. data/features/example_groups/shared_examples.feature +0 -294
  96. data/features/expectation_framework_integration/configure_expectation_framework.feature +0 -197
  97. data/features/filtering/exclusion_filters.feature +0 -138
  98. data/features/filtering/if_and_unless.feature +0 -168
  99. data/features/filtering/inclusion_filters.feature +0 -105
  100. data/features/formatters/configurable_colors.feature +0 -31
  101. data/features/formatters/custom_formatter.feature +0 -36
  102. data/features/formatters/json_formatter.feature +0 -30
  103. data/features/formatters/text_formatter.feature +0 -46
  104. data/features/helper_methods/arbitrary_methods.feature +0 -40
  105. data/features/helper_methods/let.feature +0 -50
  106. data/features/helper_methods/modules.feature +0 -149
  107. data/features/hooks/around_hooks.feature +0 -343
  108. data/features/hooks/before_and_after_hooks.feature +0 -427
  109. data/features/hooks/filtering.feature +0 -234
  110. data/features/metadata/current_example.feature +0 -56
  111. data/features/metadata/described_class.feature +0 -17
  112. data/features/metadata/user_defined.feature +0 -113
  113. data/features/mock_framework_integration/use_any_framework.feature +0 -106
  114. data/features/mock_framework_integration/use_flexmock.feature +0 -96
  115. data/features/mock_framework_integration/use_mocha.feature +0 -97
  116. data/features/mock_framework_integration/use_rr.feature +0 -98
  117. data/features/mock_framework_integration/use_rspec.feature +0 -97
  118. data/features/pending/pending_examples.feature +0 -229
  119. data/features/spec_files/arbitrary_file_suffix.feature +0 -13
  120. data/features/step_definitions/additional_cli_steps.rb +0 -49
  121. data/features/subject/attribute_of_subject.feature +0 -124
  122. data/features/subject/explicit_subject.feature +0 -101
  123. data/features/subject/implicit_subject.feature +0 -63
  124. data/features/subject/one_liner_syntax.feature +0 -71
  125. data/features/support/env.rb +0 -14
  126. data/features/support/rubinius.rb +0 -6
  127. data/lib/autotest/discover.rb +0 -10
  128. data/lib/autotest/rspec2.rb +0 -77
  129. data/lib/rspec/core/backtrace_cleaner.rb +0 -46
  130. data/lib/rspec/core/backward_compatibility.rb +0 -55
  131. data/lib/rspec/core/caller_filter.rb +0 -60
  132. data/lib/rspec/core/command_line.rb +0 -47
  133. data/lib/rspec/core/deprecated_mutable_array_proxy.rb +0 -32
  134. data/lib/rspec/core/deprecation.rb +0 -26
  135. data/lib/rspec/core/drb_command_line.rb +0 -26
  136. data/lib/rspec/core/drb_options.rb +0 -87
  137. data/lib/rspec/core/extensions/instance_eval_with_args.rb +0 -44
  138. data/lib/rspec/core/extensions/kernel.rb +0 -9
  139. data/lib/rspec/core/extensions/module_eval_with_args.rb +0 -38
  140. data/lib/rspec/core/extensions/ordered.rb +0 -27
  141. data/lib/rspec/core/formatters/text_mate_formatter.rb +0 -34
  142. data/lib/rspec/core/metadata_hash_builder.rb +0 -97
  143. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +0 -11
  144. data/lib/rspec/core/mocking/with_flexmock.rb +0 -27
  145. data/lib/rspec/core/mocking/with_rr.rb +0 -27
  146. data/lib/rspec/core/mocking/with_rspec.rb +0 -27
  147. data/lib/rspec/core/shared_example_group/collection.rb +0 -45
  148. data/spec/autotest/discover_spec.rb +0 -49
  149. data/spec/autotest/failed_results_re_spec.rb +0 -45
  150. data/spec/autotest/rspec_spec.rb +0 -133
  151. data/spec/command_line/order_spec.rb +0 -204
  152. data/spec/rspec/core/backtrace_cleaner_spec.rb +0 -68
  153. data/spec/rspec/core/caller_filter_spec.rb +0 -58
  154. data/spec/rspec/core/command_line_spec.rb +0 -127
  155. data/spec/rspec/core/command_line_spec_output.txt +0 -0
  156. data/spec/rspec/core/configuration_options_spec.rb +0 -417
  157. data/spec/rspec/core/configuration_spec.rb +0 -2072
  158. data/spec/rspec/core/deprecation_spec.rb +0 -27
  159. data/spec/rspec/core/deprecations_spec.rb +0 -59
  160. data/spec/rspec/core/drb_command_line_spec.rb +0 -102
  161. data/spec/rspec/core/drb_options_spec.rb +0 -193
  162. data/spec/rspec/core/dsl_spec.rb +0 -25
  163. data/spec/rspec/core/example_group_spec.rb +0 -1337
  164. data/spec/rspec/core/example_spec.rb +0 -502
  165. data/spec/rspec/core/filter_manager_spec.rb +0 -246
  166. data/spec/rspec/core/formatters/base_formatter_spec.rb +0 -108
  167. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +0 -524
  168. data/spec/rspec/core/formatters/console_codes_spec.rb +0 -50
  169. data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +0 -263
  170. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +0 -89
  171. data/spec/rspec/core/formatters/helpers_spec.rb +0 -104
  172. data/spec/rspec/core/formatters/html_formatted.html +0 -397
  173. data/spec/rspec/core/formatters/html_formatter_spec.rb +0 -131
  174. data/spec/rspec/core/formatters/json_formatter_spec.rb +0 -115
  175. data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -30
  176. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +0 -26
  177. data/spec/rspec/core/formatters/text_mate_formatted.html +0 -397
  178. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +0 -107
  179. data/spec/rspec/core/hooks_filtering_spec.rb +0 -227
  180. data/spec/rspec/core/hooks_spec.rb +0 -269
  181. data/spec/rspec/core/kernel_extensions_spec.rb +0 -9
  182. data/spec/rspec/core/memoized_helpers_spec.rb +0 -776
  183. data/spec/rspec/core/metadata_spec.rb +0 -514
  184. data/spec/rspec/core/option_parser_spec.rb +0 -297
  185. data/spec/rspec/core/pending_example_spec.rb +0 -260
  186. data/spec/rspec/core/pending_spec.rb +0 -27
  187. data/spec/rspec/core/project_initializer_spec.rb +0 -130
  188. data/spec/rspec/core/rake_task_spec.rb +0 -202
  189. data/spec/rspec/core/reporter_spec.rb +0 -167
  190. data/spec/rspec/core/resources/a_bar.rb +0 -0
  191. data/spec/rspec/core/resources/a_foo.rb +0 -0
  192. data/spec/rspec/core/resources/a_spec.rb +0 -1
  193. data/spec/rspec/core/resources/custom_example_group_runner.rb +0 -14
  194. data/spec/rspec/core/resources/formatter_specs.rb +0 -60
  195. data/spec/rspec/core/resources/utf8_encoded.rb +0 -8
  196. data/spec/rspec/core/rspec_matchers_spec.rb +0 -45
  197. data/spec/rspec/core/ruby_project_spec.rb +0 -26
  198. data/spec/rspec/core/runner_spec.rb +0 -82
  199. data/spec/rspec/core/shared_context_spec.rb +0 -114
  200. data/spec/rspec/core/shared_example_group/collection_spec.rb +0 -70
  201. data/spec/rspec/core/shared_example_group_spec.rb +0 -138
  202. data/spec/rspec/core/world_spec.rb +0 -142
  203. data/spec/rspec/core_spec.rb +0 -108
  204. data/spec/spec_helper.rb +0 -135
  205. data/spec/support/config_options_helper.rb +0 -15
  206. data/spec/support/helper_methods.rb +0 -55
  207. data/spec/support/in_sub_process.rb +0 -37
  208. data/spec/support/isolate_load_path_mutation.rb +0 -6
  209. data/spec/support/isolated_directory.rb +0 -10
  210. data/spec/support/isolated_home_directory.rb +0 -16
  211. data/spec/support/matchers.rb +0 -65
  212. data/spec/support/mathn_integration_support.rb +0 -12
  213. data/spec/support/sandboxed_mock_space.rb +0 -116
  214. data/spec/support/shared_example_groups.rb +0 -42
  215. data/spec/support/silence_dsl_deprecations.rb +0 -32
  216. data/spec/support/spec_files.rb +0 -44
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDVlNDg3NzUxMWY5NDk2MzQ2ZDQyMDhmNWY4YjJmZmEwOTgwMzZiMw==
4
+ MjlhNTVjYmI4MjQwNDYwMWViMjUzNDBlZTg0OWE3MmIxMTMwMTNmYw==
5
5
  data.tar.gz: !binary |-
6
- MjkzYTI0M2ZkN2IxYzAxYmM1NmY1MWUzYjhmNDY5NGFhNjk0MjZiMA==
6
+ YmYxZTAyNzhjNTgzNTRjMzk1OWQyMWU5NzQ5MDNmMWVlNTA0ZTRhYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzBjODk5ZmU4ZTEzODk0ZmIyMTkwOTFiNWNhZTg2YWU4Yjc5ZjcxN2JkYWFm
10
- YWE4ODk3YWFkZTkwM2M2NGZlZTFjYjI1ODRmNGIyOWY0YjQ0ZjMwNDhjNTUz
11
- MDBjZDA3NjI2YWM1NmM2NGVlYzM1ZDE0ZDlmMjVlMmFkZGQ0NTU=
9
+ MTI1OTczM2M4NDgxNjRiN2YyNDBkZDdhM2FiZmVhNGFjMmQ2NjA4OGMwMWNk
10
+ ODkwM2ZjZWI5ZmFkOTlmY2QzZGFmOTA3NDIwMjcxOGRjMjk5Mzg3YWJmNjE2
11
+ YzdkNTc2Y2IzMmQ0YzY0MmNmOTk5ZGNmNzZlNDc4ZGJmZWQ3YTU=
12
12
  data.tar.gz: !binary |-
13
- NTkwMmUxMzViOWE1MjQ2NTMzMTEwZWU1ODY4ODgxYjBlZjdkNjU3ODM2NDc5
14
- YWRkNjA2M2U0NDE1OWJiOTNiN2E3ZTg3MDk4OTdlOTUwODk2M2JlMzBkZjU1
15
- ODZlMjY4MjBkNWQ3YzgzMTUzNmJjZTFkMDllNTlkZTBmYjU0YjU=
13
+ NGJjMDgwMDZlNzQ0YTI3YmZkYjY5OGVjNDc4ZTFmYmUxMGYwMGFlYWY0MDlm
14
+ Mjg1ZGRkNTMzZGI2MTNhYWIxNmFlOGRlYThkYmZhOGM5N2FjNmQwM2Y2OTdm
15
+ ZWNlZTg3NmZhOTA3NWZjODRmNmQwMTA5NDkzNTM5MmMxMjY3YTM=
checksums.yaml.gz.sig ADDED
Binary file
data/.yardopts CHANGED
@@ -1,6 +1,7 @@
1
1
  --exclude features
2
2
  --no-private
3
3
  --markup markdown
4
+ --default-return void
4
5
  -
5
6
  Changelog.md
6
7
  License.txt
data/Changelog.md CHANGED
@@ -1,3 +1,341 @@
1
+ ### 3.0.0 / 2014-06-01
2
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.0.0.rc1...v3.0.0)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix `BaseTextFormatter` so that it does not re-close a closed output
7
+ stream. (Myron Marston)
8
+ * Fix regression in metadata that caused the metadata hash of a top-level
9
+ example group to have a `:parent_example_group` key even though it has
10
+ no parent example group. (Myron Marston)
11
+
12
+ Enhancements:
13
+
14
+ * Alter the default `spec_helper.rb` to no longer recommend
15
+ `config.full_backtrace = true` see #1536 for discussion. (Jon Rowe)
16
+
17
+ ### 3.0.0.rc1 / 2014-05-18
18
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.0.0.beta2...v3.0.0.rc1)
19
+
20
+ Breaking Changes for 3.0.0:
21
+
22
+ * Change `described_class` so that in a nested group like `describe
23
+ MyClass`, it returns `MyClass` rather than the outer group's described
24
+ class. (Myron Marston)
25
+ * Refactor filter manager so that it no longer subclasses Hash and has a
26
+ tighter, more domain-specific interface. (Sergey Pchelincev)
27
+ * Remove legacy colours definitions from `BaseTextFormatter`. (Jon Rowe)
28
+ * Remove console color definitions from `BaseTextFormatter`. (Jon Rowe)
29
+ * Restructure example group metadata so that the computed keys are
30
+ exposed directly off of the metadata hash rather than being on
31
+ a nested `:example_group` subhash. In addition, the parent example
32
+ group metadata is now available as `[:parent_example_group]` rather
33
+ than `[:example_group][:example_group]`. Deprecated access via the
34
+ old key structure is still provided. (Myron Marston)
35
+ * Remove `:describes` metadata key. It duplicates `:described_class`
36
+ for no good reason. Deprecated access via `:describes` is still
37
+ provided. (Myron Marston)
38
+ * Rename `:example_group_block` metadata key to `:block`.
39
+ (Myron Marston)
40
+ * Remove deprecated `RSpec::Core::Example#options`. (Myron Marston)
41
+ * Move `BaseTextFormatter#colorize_summary` to `SummaryNotification#colorize_with`
42
+ (Jon Rowe).
43
+ * `describe some_hash` treated `some_hash` as metadata in RSpec 2.x but
44
+ will treat it as the described object in RSpec 3.0. Metadata must
45
+ always come after the description args. (Myron Marston)
46
+ * Remove deprecated `display_name` alias of `ExampleGroup.description`.
47
+ (Myron Marston)
48
+ * Remove deprecated `describes` alias of `ExampleGroup.described_class`.
49
+ (Myron Marston)
50
+ * Remove deprecated `RSpec::Core::ExampleGroup.alias_it_behaves_like_to`.
51
+ Use `RSpec::Core::Configuration#alias_it_behaves_like_to` instead.
52
+ (Myron Marston)
53
+ * Remove deprecated `RSpec::Core::ExampleGroup.alias_example_to`.
54
+ Use `RSpec::Core::Configuration#alias_example_to` instead.
55
+ (Myron Marston)
56
+ * Removed `focused` example alias and change example/group aliases
57
+ `fit`, `focus`, `fcontext` and `fdescribe` to no longer include
58
+ `:focused => true` metadata. They only contain `:focus => true`
59
+ metadata now. This means that you will need to filter them with
60
+ `filter_run :focus`, not `filter_run :focused`. (Myron Marston)
61
+ * Remove `--line-number` filtering. It's semantically dubious since it's
62
+ a global filter (potentially applied to multiple files) but there's no
63
+ meaningful connection between the same line number in multiple files.
64
+ Instead use the `rspec path/to/spec.rb:23:46` form, which is terser
65
+ and makes more sense as it is scoped to a file. (Myron Marston)
66
+ * Remove `--default_path` as an alias for `--default-path`. (Jon Rowe)
67
+ * Remove deprecated `share_examples_for`. There's still
68
+ `shared_examples` and `shared_examples_for`. (Myron Marston)
69
+ * Rename `RSpec::Core::Configuration#warnings` to
70
+ `RSpec::Core::Configuration#warnings?` since it's a boolean flag.
71
+ (Myron Marston)
72
+ * RSpec's global state is no longer reset after a spec run. This gives
73
+ more flexibility to alternate runners to decide when and if they
74
+ want the state reset. Alternate runners are now responsible for
75
+ calling this (or doing a similar reset) if they are going to run
76
+ the spec suite multiple times in the same process. (Sam Phippen)
77
+ * Merge `RSpec::Core::CommandLine` (never formally declared public)
78
+ into `RSpec::Core::Runner`. (Myron Marston)
79
+ * Remove `color_enabled` as an alias of `color`. (Jon Rowe)
80
+ * Remove `backtrace_cleaner` as an alias of `backtrace_formatter`. (Jon Rowe)
81
+ * Remove `filename_pattern` as an alias of `pattern`. (Jon Rowe)
82
+ * Extract support for legacy formatters to `rspec-legacy_formatters`. (Jon Rowe)
83
+ * `RSpec::Configuration#formatters` now returns a dup to prevent mutation. (Jon Rowe)
84
+ * Replace `stdlib` as an available expectation framework with `test_unit` and
85
+ `minitest`. (Aaron Kromer)
86
+ * Remove backtrace formatting helpers from `BaseTextFormatter`. (Jon Rowe)
87
+ * Extract profiler support to `ProfileFormatter` and `ProfileNotification`.
88
+ Formatters should implement `dump_profile` if they wish to respond to `--profile`.
89
+ (Jon Rowe)
90
+ * Extract remaining formatter state to reporter and notifications. Introduce
91
+ `ExamplesNotification` to share information about examples that was previously
92
+ held in `BaseFormatter`. (Jon Rowe)
93
+
94
+ Enhancements:
95
+
96
+ * Add `config.default_formatter` attribute, which can be used to set a
97
+ formatter which will only be used if no other formatter is set
98
+ (e.g. via `--formatter`). (Myron Marston)
99
+ * Support legacy colour definitions in `LegacyFormatterAdaptor`. (Jon Rowe)
100
+ * Migrate `execution_result` (exposed by metadata) from a hash to a
101
+ first-class object with appropriate attributes. `status` is now
102
+ stored and returned as a symbol rather than a string. It retains
103
+ deprecated hash behavior for backwards compatibility. (Myron Marston)
104
+ * Provide console code helper for formatters. (Jon Rowe)
105
+ * Use raw ruby hashes for the metadata hashes rather than a subclass of
106
+ a hash. Computed metadata entries are now computed in advance rather
107
+ than being done lazily on first access. (Myron Marston)
108
+ * Add `:block` metadata entry to the example metadata, bringing
109
+ parity with `:block` in the example group metadata. (Myron Marston)
110
+ * Add `fspecify` and `fexample` as aliases of `specify` and `example`
111
+ with `:focus => true` metadata for parity with `fit`. (Myron Marston)
112
+ * Add legacy support for `colorize_summary`. (Jon Rowe)
113
+ * Restructure runner so it can be more easily customized in a subclass
114
+ for an alternate runner. (Ben Hoskings)
115
+ * Document `RSpec::Core::ConfigurationOptions` as an officially
116
+ supported public API. (Myron Marston)
117
+ * Add `--deprecation-out` CLI option which directs deprecation warnings
118
+ to the named file. (Myron Marston)
119
+ * Minitest 5 compatability for `expect_with :stdlib` (now available as
120
+ `expect_with :minitest`). (Xavier Shay)
121
+ * Reporter now notifies formatters of the load time of RSpec and your
122
+ specs via `StartNotification` and `SummaryNotification`. (Jon Rowe)
123
+ * Add `disable_monkey_patching!` config option that disables all monkey
124
+ patching from whatever pieces of RSpec you use. (Alexey Fedorov)
125
+ * Add `Pathname` support for setting all output streams. (Aaron Kromer)
126
+ * Add `config.define_derived_metadata`, which can be used to apply
127
+ additional metadata to all groups or examples that match a given
128
+ filter. (Myron Marston)
129
+ * Provide formatted and colorized backtraces via `FailedExampleNotification`
130
+ and send `PendingExampleFixedNotifications` when the error is due to a
131
+ passing spec you expect to fail. (Jon Rowe)
132
+ * Add `dump_profile` to formatter API to allow formatters to implement
133
+ support for `--profile`. (Jon Rowe)
134
+ * Allow colourising text via `ConsoleCodes` with RSpec 'states'
135
+ (e.g. `:success`, `:failure`) rather than direct colour codes. (Jon Rowe)
136
+ * Expose `fully_formatted` methods off the formatter notification objects
137
+ that make it easy for a custom formatter to produce formatted output
138
+ like rspec-core's. (Myron Marston)
139
+
140
+ Bug Fixes:
141
+
142
+ * Fix `spec_helper.rb` file generated by `rspec --init` so that the
143
+ recommended settings correctly use the documentation formatter
144
+ when running one file. (Myron Marston)
145
+ * Fix ordering problem where descriptions were generated after
146
+ tearing down mocks, which resulted in unexpected exceptions.
147
+ (Bradley Schaefer, Aaron Kromer, Andrey Savchenko)
148
+ * Allow a symbol to be used as an implicit subject (e.g. `describe
149
+ :foo`). (Myron Marston)
150
+ * Prevent creating an isolated context (i.e. using `RSpec.describe`) when
151
+ already inside a context. There is no reason to do this, and it could
152
+ potentially cause unexpected bugs. (Xavier Shay)
153
+ * Fix shared example group scoping so that when two shared example
154
+ groups share the same name at different levels of nested contexts,
155
+ the one in the nearest context is used. (Myron Marston)
156
+ * Fix `--warnings` option so that it enables warnings immediately so
157
+ that it applies to files loaded by `--require`. (Myron Marston)
158
+ * Issue a warning when you set `config.deprecation_stream` too late for
159
+ it to take effect because the reporter has already been setup. (Myron Marston)
160
+ * Add the full `RSpec::Core::Example` interface to the argument yielded
161
+ to `around` hooks. (Myron Marston)
162
+ * Line number always takes precendence when running specs with filters.
163
+ (Xavier Shay)
164
+ * Ensure :if and :unless metadata filters are treated as a special case
165
+ and are always in-effect. (Bradley Schaefer)
166
+ * Ensure the currently running installation of RSpec is used when
167
+ the rake task shells out to `rspec`, even if a newer version is also
168
+ installed. (Postmodern)
169
+ * Using a legacy formatter as default no longer causes an infinite loop.
170
+ (Xavier Shay)
171
+
172
+ ### 3.0.0.beta2 / 2014-02-17
173
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.0.0.beta1...v3.0.0.beta2)
174
+
175
+ Breaking Changes for 3.0.0:
176
+
177
+ * Make `mock_with` option more strict. Strings are no longer supported
178
+ (e.g. `mock_with "mocha"`) -- use a symbol instead. Also, unrecognized
179
+ values will now result in an error rather than falling back to the
180
+ null mocking adapter. If you want to use the null mocking adapter,
181
+ use `mock_with :nothing` (as has been documented for a long time).
182
+ (Myron Marston)
183
+ * Remove support for overriding RSpec's built-in `:if` and `:unless`
184
+ filters. (Ashish Dixit)
185
+ * Custom formatters are now required to call
186
+ `RSpec::Core::Formatters.register(formatter_class, *notifications)`
187
+ where `notifications` is the list of events the formatter wishes to
188
+ be notified about. Notifications are handled by methods matching the
189
+ names on formatters. This allows us to add or remove notifications
190
+ without breaking existing formatters. (Jon Rowe)
191
+ * Change arguments passed to formatters. Rather than passing multiple
192
+ arguments (which limits are ability to add additional arguments as
193
+ doing so would break existing formatters), we now pass a notification
194
+ value object that exposes the same data via attributes. This will
195
+ allow us to add new bits of data to a notification event without
196
+ breaking existing formatters. (Jon Rowe)
197
+ * Remove support for deprecated `:alias` option for
198
+ `RSpec.configuration.add_setting`. (Myron Marston)
199
+ * Remove support for deprecated `RSpec.configuration.requires = [...]`.
200
+ (Myron Marston)
201
+ * Remove support for deprecated `--formatter` CLI option. (Myron Marston)
202
+ * Remove support for deprecated `--configure` CLI option. (Myron Marston)
203
+ * Remove support for deprecated `RSpec::Core::RakeTask#spec_opts=`.
204
+ (Myron Marston)
205
+ * An example group level `pending` block or `:pending` metadata now executes
206
+ the example and cause a failure if it passes, otherwise it will be pending if
207
+ it fails. The old "never run" behaviour is still used for `xexample`, `xit`,
208
+ and `xspecify`, or via a new `skip` method or `:skip` metadata option.
209
+ (Xavier Shay)
210
+ * After calling `pending` inside an example, the remainder of the example will
211
+ now be run. If it passes a failure is raised, otherwise the example is marked
212
+ pending. The old "never run" behaviour is provided a by a new `skip` method.
213
+ (Xavier Shay)
214
+ * Pending blocks inside an example have been removed as a feature with no
215
+ direct replacement. Use `skip` or `pending` without a block. (Xavier Shay)
216
+ * Pending statement is no longer allowed in `before(:all)` hooks. Use `skip`
217
+ instead. (Xavier Shay)
218
+ * Remove `show_failures_in_pending_blocks` configuration option. (Xavier Shay)
219
+ * Remove support for specifying the documentation formatter using
220
+ 's', 'n', 'spec' or 'nested'. (Jon Rowe)
221
+
222
+ Enhancements:
223
+
224
+ * Add example run time to JSON formatter output. (Karthik Kastury)
225
+ * Add more suggested settings to the files generated by
226
+ `rspec --init`. (Myron Marston)
227
+ * Add `config.alias_example_group_to`, which can be used to define a
228
+ new method that defines an example group with the provided metadata.
229
+ (Michi Huber)
230
+ * Add `xdescribe` and `xcontext` as shortcuts to skip an example group.
231
+ (Myron Marston)
232
+ * Add `fdescribe` and `fcontext` as shortcuts to focus an example group.
233
+ (Myron Marston)
234
+ * Don't autorun specs via `#at_exit` by default. `require 'rspec/autorun'`
235
+ is only needed when running specs via `ruby`, as it always has been.
236
+ Running specs via `rake` or `rspec` are both unaffected. (Ben Hoskings)
237
+ * Add `expose_dsl_globally` config option, defaulting to true. When disabled
238
+ it will remove the monkey patches rspec-core adds to `main` and `Module`
239
+ (e.g. `describe`, `shared_examples_for`, etc). (Jon Rowe)
240
+ * Expose RSpec DSL entry point methods (`describe`,
241
+ `shared_examples_for`, etc) on the `RSpec` constant. Intended for use
242
+ when `expose_dsl_globally` is set to `false`. (Jon Rowe)
243
+ * For consistency, expose all example group aliases (including
244
+ `context`) on the `RSpec` constant. If `expose_dsl_globally` is set to
245
+ `true`, also expose them on `main` and `Module`. Historically, only `describe`
246
+ was exposed. (Jon Rowe, Michi Huber)
247
+ * Add hook scope `:example` as an alias for `:each`, and `:context` as an alias
248
+ for `:all`. (John Feminella)
249
+
250
+ Bug Fixes:
251
+
252
+ * Fix failure (undefined method `path`) in end-of-run summary
253
+ when `raise_errors_for_deprecations!` is configured. (Myron Marston)
254
+ * Issue error when attempting to use `-i` or `--I` on command line,
255
+ too close to `-I` to be considered short hand for `--init`. (Jon Rowe)
256
+ * Prevent adding formatters to an output target if the same
257
+ formatter has already been added to that output. (Alex Peattie)
258
+ * Allow a matcher-generated example description to be used when
259
+ the example is pending. (Myron Marston)
260
+ * Ensure the configured `failure_exit_code` is used by the rake
261
+ task when there is a failure. (Jon Rowe)
262
+ * Restore behaviour whereby system exclusion filters take priority over working
263
+ directory (was broken in beta1). (Jon Rowe)
264
+ * Prevent RSpec mangling file names that have substrings containing `line_number`
265
+ or `default_path`. (Matijs van Zuijlen)
266
+
267
+ ### 3.0.0.beta1 / 2013-11-07
268
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v2.99.0...v3.0.0.beta1)
269
+
270
+ Breaking Changes for 3.0.0:
271
+
272
+ * Remove explicit support for 1.8.6. (Jon Rowe)
273
+ * Remove `RSpec::Core::ExampleGroup#example` and
274
+ `RSpec::Core::ExampleGroup#running_example` methods. If you need
275
+ access to the example (e.g. to get its metadata), use a block arg
276
+ instead. (David Chelimsky)
277
+ * Remove `TextMateFormatter`, it has been moved to `rspec-tmbundle`.
278
+ (Aaron Kromer)
279
+ * Remove RCov integration. (Jon Rowe)
280
+ * Remove deprecated support for RSpec 1 constructs (Myron Marston):
281
+ * The `Spec` and `Rspec` constants (rather than `RSpec`).
282
+ * `Spec::Runner.configure` rather than `RSpec.configure`.
283
+ * `Rake::SpecTask` rather than `RSpec::Core::RakeTask`.
284
+ * Remove deprecated support for `share_as`. (Myron Marston)
285
+ * Remove `--debug` option (and corresponding option on
286
+ `RSpec::Core::Configuration`). Instead, use `-r<debugger gem name>` to
287
+ load whichever debugger gem you wish to use (e.g. `ruby-debug`,
288
+ `debugger`, or `pry`). (Myron Marston)
289
+ * Extract Autotest support to a seperate gem. (Jon Rowe)
290
+ * Raise an error when a `let` or `subject` declaration is
291
+ accessed in a `before(:all)` or `after(:all)` hook. (Myron Marston)
292
+ * Extract `its` support to a separate gem. (Peter Alfvin)
293
+ * Disallow use of a shared example group from sibling contexts, making them
294
+ fully isolated. 2.14 and 2.99 allowed this but printed a deprecation warning.
295
+ (Jon Rowe)
296
+ * Remove `RSpec::Core::Configuration#output` and
297
+ `RSpec::Core::Configuration#out` aliases of
298
+ `RSpec::Core::Configuration#output_stream`. (Myron Marston)
299
+ * Remove legacy ordering APIs deprecated in 2.99.0.beta1. (Myron
300
+ Marston)
301
+
302
+ Enhancements:
303
+
304
+ * Replace unmaintained syntax gem with coderay gem. (Xavier Shay)
305
+ * Times in profile output are now bold instead of `failure_color`.
306
+ (Matthew Boedicker)
307
+ * Add `--no-fail-fast` command line option. (Gonzalo Rodríguez-Baltanás Díaz)
308
+ * Runner now considers the local system ip address when running under Drb.
309
+ (Adrian CB)
310
+ * JsonFormatter now includes `--profile` information. (Alex / @MasterLambaster)
311
+ * Always treat symbols passed as metadata args as hash
312
+ keys with true values. RSpec 2 supported this with the
313
+ `treat_symbols_as_metadata_keys_with_true_values` but
314
+ now this behavior is always enabled. (Myron Marston)
315
+ * Add `--dry-run` option, which prints the formatter output
316
+ of your suite without running any examples or hooks.
317
+ (Thomas Stratmann, Myron Marston)
318
+ * Document the configuration options and default values in the `spec_helper.rb`
319
+ file that is generated by RSpec. (Parker Selbert)
320
+ * Give generated example group classes a friendly name derived
321
+ from the docstring, rather than something like "Nested_2".
322
+ (Myron Marston)
323
+ * Avoid affecting randomization of user code when shuffling
324
+ examples so that users can count on their own seeds
325
+ working. (Travis Herrick)
326
+ * Ordering is no longer a single global property of the test suite.
327
+ Each group can pick an ordering using `:order` metadata. (Andy
328
+ Lindeman, Sam Phippen, Myron Marston)
329
+ * Allow named custom ordering strategies to be registered, which can
330
+ then be used on individual example groups. (Andy Lindeman, Sam
331
+ Phippen, Myron Marston)
332
+
333
+ Deprecations:
334
+
335
+ * `treat_symbols_as_metadata_keys_with_true_values` is deprecated and no
336
+ longer has an affect now that the behavior it enabled is always
337
+ enabled. (Myron Marston)
338
+
1
339
  ### 2.99.0 / 2014-06-01
2
340
  [Full Changelog](http://github.com/rspec/rspec-core/compare/v2.99.0.rc1...v2.99.0)
3
341
 
@@ -117,7 +455,7 @@ Bug Fixes:
117
455
 
118
456
  * Fix failure (undefined method `path`) in end-of-run summary
119
457
  when `raise_errors_for_deprecations!` is configured. (Myron Marston)
120
- * Fix issue were overridding spec ordering from the command line wasnt
458
+ * Fix issue were overridding spec ordering from the command line wasn't
121
459
  fully recognised interally. (Jon Rowe)
122
460
 
123
461
  ### 2.99.0.beta1 / 2013-11-07
data/License.txt CHANGED
@@ -1,5 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
+ Copyright (c) 2012 Chad Humphries, David Chelimsky, Myron Marston
3
4
  Copyright (c) 2009 Chad Humphries, David Chelimsky
4
5
  Copyright (c) 2006 David Chelimsky, The RSpec Development Team
5
6
  Copyright (c) 2005 Steven Baker
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # rspec-core [![Build Status](https://secure.travis-ci.org/rspec/rspec-core.png?branch=master)](http://travis-ci.org/rspec/rspec-core) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.png)](https://codeclimate.com/github/rspec/rspec-core)
1
+ # rspec-core [![Build Status](https://secure.travis-ci.org/rspec/rspec-core.png?branch=master)](http://travis-ci.org/rspec/rspec-core) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.png)](https://codeclimate.com/github/rspec/rspec-core) [![Inline docs](http://inch-pages.github.io/github/rspec/rspec-core.png)](http://inch-pages.github.io/github/rspec/rspec-core)
2
2
 
3
3
  rspec-core provides the structure for writing executable examples of how your
4
4
  code should behave, and an `rspec` command with tools to constrain which
@@ -18,7 +18,7 @@ RSpec uses the words "describe" and "it" so we can express concepts like a conve
18
18
  "It sums the prices of its line items."
19
19
 
20
20
  ```ruby
21
- describe Order do
21
+ RSpec.describe Order do
22
22
  it "sums the prices of its line items" do
23
23
  order = Order.new
24
24
  order.add_entry(LineItem.new(:item => Item.new(
@@ -46,7 +46,7 @@ You can also declare nested nested groups using the `describe` or `context`
46
46
  methods:
47
47
 
48
48
  ```ruby
49
- describe Order do
49
+ RSpec.describe Order do
50
50
  context "with no items" do
51
51
  it "behaves one way" do
52
52
  # ...
@@ -63,8 +63,11 @@ end
63
63
 
64
64
  ## aliases
65
65
 
66
- You can declare example groups using either `describe` or `context`, though
67
- only `describe` is available at the top level.
66
+ You can declare example groups using either `describe` or `context`.
67
+ For a top level example group, `describe` and `context` are available
68
+ off of `RSpec`. For backwards compatibility, they are also available
69
+ off of the `main` object and `Module` unless you disable monkey
70
+ patching.
68
71
 
69
72
  You can declare examples within a group using any of `it`, `specify`, or
70
73
  `example`.
@@ -75,17 +78,17 @@ Declare a shared example group using `shared_examples`, and then include it
75
78
  in any group using `include_examples`.
76
79
 
77
80
  ```ruby
78
- shared_examples "collections" do |collection_class|
81
+ RSpec.shared_examples "collections" do |collection_class|
79
82
  it "is empty when first created" do
80
83
  expect(collection_class.new).to be_empty
81
84
  end
82
85
  end
83
86
 
84
- describe Array do
87
+ RSpec.describe Array do
85
88
  include_examples "collections", Array
86
89
  end
87
90
 
88
- describe Hash do
91
+ RSpec.describe Hash do
89
92
  include_examples "collections", Hash
90
93
  end
91
94
  ```
@@ -123,7 +126,7 @@ using the `described_class` method, which is a wrapper for
123
126
  `example.metadata[:described_class]`.
124
127
 
125
128
  ```ruby
126
- describe Widget do
129
+ RSpec.describe Widget do
127
130
  example do
128
131
  expect(described_class).to equal(Widget)
129
132
  end
@@ -135,17 +138,17 @@ class is unknown. Taking the collections shared example group from above, we can
135
138
  clean it up a bit using `described_class`:
136
139
 
137
140
  ```ruby
138
- shared_examples "collections" do
141
+ RSpec.shared_examples "collections" do
139
142
  it "is empty when first created" do
140
143
  expect(described_class.new).to be_empty
141
144
  end
142
145
  end
143
146
 
144
- describe Array do
147
+ RSpec.describe Array do
145
148
  include_examples "collections"
146
149
  end
147
150
 
148
- describe Hash do
151
+ RSpec.describe Hash do
149
152
  include_examples "collections"
150
153
  end
151
154
  ```
@@ -165,30 +168,9 @@ the command line.
165
168
 
166
169
  ## autotest integration
167
170
 
168
- rspec-core ships with an Autotest extension, which is loaded automatically if
169
- there is a `.rspec` file in the project's root directory.
170
-
171
- ## rcov integration
172
-
173
- rcov is best integrated via the [rcov rake
174
- task](http://www.rubydoc.info/github/relevance/rcov/master/Rcov/RcovTask).
175
-
176
- rcov can also be integrated via the rspec rake task, but it requires a bit
177
- more setup:
178
-
179
- ```ruby
180
- # Rakefile
181
- require 'rspec/core/rake_task'
182
-
183
- RSpec::Core::RakeTask.new(:spec) do |config|
184
- config.rcov = true
185
- end
186
-
187
- task :default => :spec
188
-
189
- # spec/spec_helper.rb
190
- require 'rspec/autorun' # **add this**
191
- ```
171
+ rspec-core no longer ships with an Autotest extension, if you require Autotest
172
+ integration, please use the `rspec-autotest` gem and see [rspec/rspec-autotest](https://github.com/rspec/rspec-autotest)
173
+ for details
192
174
 
193
175
  ## get started
194
176
 
@@ -197,7 +179,7 @@ this before you write any implementation code:
197
179
 
198
180
  ```ruby
199
181
  # in spec/calculator_spec.rb
200
- describe Calculator do
182
+ RSpec.describe Calculator do
201
183
  describe '#add' do
202
184
  it 'returns the sum of its arguments' do
203
185
  expect(Calculator.new.add(1, 2)).to eq(3)
data/exe/rspec CHANGED
@@ -1,25 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- begin
4
- require 'rspec/autorun'
5
- rescue LoadError
6
- $stderr.puts <<-EOS
7
- #{'*'*50}
8
- Could not find 'rspec/autorun'
9
-
10
- This may happen if you're using rubygems as your package manager, but it is not
11
- being required through some mechanism before executing the rspec command.
12
-
13
- You may need to do one of the following in your shell:
14
-
15
- # for bash/zsh
16
- export RUBYOPT=rubygems
17
-
18
- # for csh, etc.
19
- set RUBYOPT=rubygems
20
-
21
- For background, please see http://gist.github.com/54177.
22
- #{'*'*50}
23
- EOS
24
- exit(1)
25
- end
3
+ require 'rspec/core'
4
+ RSpec::Core::Runner.invoke