gem_repackager 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (567) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +22 -0
  4. data/README.md +56 -0
  5. data/Rakefile +9 -0
  6. data/bin/gem_repackager +57 -0
  7. data/gem_repackager.gemspec +22 -0
  8. data/lib/gem_repackager.rb +131 -0
  9. data/lib/gem_repackager/version.rb +5 -0
  10. data/spec/packager_spec.rb +131 -0
  11. data/spec/spec_helper.rb +1 -0
  12. data/support/bin/rspec +19 -0
  13. data/support/gems/rspec-2.11.0/License.txt +24 -0
  14. data/support/gems/rspec-2.11.0/README.md +47 -0
  15. data/support/gems/rspec-2.11.0/lib/rspec.rb +4 -0
  16. data/support/gems/rspec-2.11.0/lib/rspec/version.rb +5 -0
  17. data/support/gems/rspec-core-2.11.1/.document +5 -0
  18. data/support/gems/rspec-core-2.11.1/.yardopts +6 -0
  19. data/support/gems/rspec-core-2.11.1/Changelog.md +570 -0
  20. data/support/gems/rspec-core-2.11.1/License.txt +24 -0
  21. data/support/gems/rspec-core-2.11.1/README.md +235 -0
  22. data/support/gems/rspec-core-2.11.1/exe/autospec +13 -0
  23. data/support/gems/rspec-core-2.11.1/exe/rspec +25 -0
  24. data/support/gems/rspec-core-2.11.1/features/Autotest.md +38 -0
  25. data/support/gems/rspec-core-2.11.1/features/README.md +17 -0
  26. data/support/gems/rspec-core-2.11.1/features/Upgrade.md +364 -0
  27. data/support/gems/rspec-core-2.11.1/features/command_line/README.md +28 -0
  28. data/support/gems/rspec-core-2.11.1/features/command_line/example_name_option.feature +101 -0
  29. data/support/gems/rspec-core-2.11.1/features/command_line/exit_status.feature +83 -0
  30. data/support/gems/rspec-core-2.11.1/features/command_line/format_option.feature +81 -0
  31. data/support/gems/rspec-core-2.11.1/features/command_line/init.feature +18 -0
  32. data/support/gems/rspec-core-2.11.1/features/command_line/line_number_appended_to_path.feature +140 -0
  33. data/support/gems/rspec-core-2.11.1/features/command_line/line_number_option.feature +58 -0
  34. data/support/gems/rspec-core-2.11.1/features/command_line/order.feature +29 -0
  35. data/support/gems/rspec-core-2.11.1/features/command_line/pattern_option.feature +31 -0
  36. data/support/gems/rspec-core-2.11.1/features/command_line/rake_task.feature +68 -0
  37. data/support/gems/rspec-core-2.11.1/features/command_line/ruby.feature +22 -0
  38. data/support/gems/rspec-core-2.11.1/features/command_line/tag.feature +91 -0
  39. data/support/gems/rspec-core-2.11.1/features/configuration/alias_example_to.feature +48 -0
  40. data/support/gems/rspec-core-2.11.1/features/configuration/custom_settings.feature +84 -0
  41. data/support/gems/rspec-core-2.11.1/features/configuration/default_path.feature +38 -0
  42. data/support/gems/rspec-core-2.11.1/features/configuration/fail_fast.feature +77 -0
  43. data/support/gems/rspec-core-2.11.1/features/configuration/read_options_from_file.feature +87 -0
  44. data/support/gems/rspec-core-2.11.1/features/example_groups/basic_structure.feature +55 -0
  45. data/support/gems/rspec-core-2.11.1/features/example_groups/shared_context.feature +74 -0
  46. data/support/gems/rspec-core-2.11.1/features/example_groups/shared_examples.feature +204 -0
  47. data/support/gems/rspec-core-2.11.1/features/expectation_framework_integration/configure_expectation_framework.feature +102 -0
  48. data/support/gems/rspec-core-2.11.1/features/filtering/exclusion_filters.feature +139 -0
  49. data/support/gems/rspec-core-2.11.1/features/filtering/if_and_unless.feature +168 -0
  50. data/support/gems/rspec-core-2.11.1/features/filtering/inclusion_filters.feature +105 -0
  51. data/support/gems/rspec-core-2.11.1/features/filtering/run_all_when_everything_filtered.feature +46 -0
  52. data/support/gems/rspec-core-2.11.1/features/formatters/custom_formatter.feature +36 -0
  53. data/support/gems/rspec-core-2.11.1/features/formatters/text_formatter.feature +46 -0
  54. data/support/gems/rspec-core-2.11.1/features/helper_methods/arbitrary_methods.feature +40 -0
  55. data/support/gems/rspec-core-2.11.1/features/helper_methods/let.feature +50 -0
  56. data/support/gems/rspec-core-2.11.1/features/helper_methods/modules.feature +149 -0
  57. data/support/gems/rspec-core-2.11.1/features/hooks/around_hooks.feature +343 -0
  58. data/support/gems/rspec-core-2.11.1/features/hooks/before_and_after_hooks.feature +423 -0
  59. data/support/gems/rspec-core-2.11.1/features/hooks/filtering.feature +234 -0
  60. data/support/gems/rspec-core-2.11.1/features/metadata/current_example.feature +17 -0
  61. data/support/gems/rspec-core-2.11.1/features/metadata/described_class.feature +17 -0
  62. data/support/gems/rspec-core-2.11.1/features/metadata/user_defined.feature +113 -0
  63. data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_any_framework.feature +106 -0
  64. data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_flexmock.feature +96 -0
  65. data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_mocha.feature +97 -0
  66. data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_rr.feature +98 -0
  67. data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_rspec.feature +97 -0
  68. data/support/gems/rspec-core-2.11.1/features/pending/pending_examples.feature +229 -0
  69. data/support/gems/rspec-core-2.11.1/features/spec_files/arbitrary_file_suffix.feature +13 -0
  70. data/support/gems/rspec-core-2.11.1/features/step_definitions/additional_cli_steps.rb +30 -0
  71. data/support/gems/rspec-core-2.11.1/features/subject/attribute_of_subject.feature +124 -0
  72. data/support/gems/rspec-core-2.11.1/features/subject/explicit_subject.feature +82 -0
  73. data/support/gems/rspec-core-2.11.1/features/subject/implicit_receiver.feature +29 -0
  74. data/support/gems/rspec-core-2.11.1/features/subject/implicit_subject.feature +63 -0
  75. data/support/gems/rspec-core-2.11.1/features/support/env.rb +12 -0
  76. data/support/gems/rspec-core-2.11.1/lib/autotest/discover.rb +1 -0
  77. data/support/gems/rspec-core-2.11.1/lib/autotest/rspec2.rb +73 -0
  78. data/support/gems/rspec-core-2.11.1/lib/rspec/autorun.rb +2 -0
  79. data/support/gems/rspec-core-2.11.1/lib/rspec/core.rb +126 -0
  80. data/support/gems/rspec-core-2.11.1/lib/rspec/core/backward_compatibility.rb +65 -0
  81. data/support/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb +36 -0
  82. data/support/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb +944 -0
  83. data/support/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb +129 -0
  84. data/support/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb +36 -0
  85. data/support/gems/rspec-core-2.11.1/lib/rspec/core/drb_command_line.rb +26 -0
  86. data/support/gems/rspec-core-2.11.1/lib/rspec/core/drb_options.rb +87 -0
  87. data/support/gems/rspec-core-2.11.1/lib/rspec/core/dsl.rb +26 -0
  88. data/support/gems/rspec-core-2.11.1/lib/rspec/core/example.rb +330 -0
  89. data/support/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb +466 -0
  90. data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions.rb +4 -0
  91. data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/instance_eval_with_args.rb +44 -0
  92. data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/kernel.rb +9 -0
  93. data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/module_eval_with_args.rb +38 -0
  94. data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/ordered.rb +21 -0
  95. data/support/gems/rspec-core-2.11.1/lib/rspec/core/filter_manager.rb +203 -0
  96. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/base_formatter.rb +168 -0
  97. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/base_text_formatter.rb +203 -0
  98. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/documentation_formatter.rb +67 -0
  99. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/helpers.rb +39 -0
  100. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/html_formatter.rb +464 -0
  101. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/progress_formatter.rb +32 -0
  102. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/snippet_extractor.rb +58 -0
  103. data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
  104. data/support/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb +495 -0
  105. data/support/gems/rspec-core-2.11.1/lib/rspec/core/let.rb +110 -0
  106. data/support/gems/rspec-core-2.11.1/lib/rspec/core/load_path.rb +3 -0
  107. data/support/gems/rspec-core-2.11.1/lib/rspec/core/metadata.rb +276 -0
  108. data/support/gems/rspec-core-2.11.1/lib/rspec/core/metadata_hash_builder.rb +97 -0
  109. data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
  110. data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_flexmock.rb +27 -0
  111. data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_mocha.rb +29 -0
  112. data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_rr.rb +27 -0
  113. data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_rspec.rb +23 -0
  114. data/support/gems/rspec-core-2.11.1/lib/rspec/core/option_parser.rb +181 -0
  115. data/support/gems/rspec-core-2.11.1/lib/rspec/core/pending.rb +101 -0
  116. data/support/gems/rspec-core-2.11.1/lib/rspec/core/project_initializer.rb +87 -0
  117. data/support/gems/rspec-core-2.11.1/lib/rspec/core/rake_task.rb +179 -0
  118. data/support/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb +102 -0
  119. data/support/gems/rspec-core-2.11.1/lib/rspec/core/ruby_project.rb +44 -0
  120. data/support/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb +76 -0
  121. data/support/gems/rspec-core-2.11.1/lib/rspec/core/shared_context.rb +49 -0
  122. data/support/gems/rspec-core-2.11.1/lib/rspec/core/shared_example_group.rb +96 -0
  123. data/support/gems/rspec-core-2.11.1/lib/rspec/core/subject.rb +219 -0
  124. data/support/gems/rspec-core-2.11.1/lib/rspec/core/version.rb +7 -0
  125. data/support/gems/rspec-core-2.11.1/lib/rspec/core/world.rb +128 -0
  126. data/support/gems/rspec-core-2.11.1/spec/autotest/discover_spec.rb +19 -0
  127. data/support/gems/rspec-core-2.11.1/spec/autotest/failed_results_re_spec.rb +45 -0
  128. data/support/gems/rspec-core-2.11.1/spec/autotest/rspec_spec.rb +123 -0
  129. data/support/gems/rspec-core-2.11.1/spec/command_line/order_spec.rb +137 -0
  130. data/support/gems/rspec-core-2.11.1/spec/rspec/core/command_line_spec.rb +108 -0
  131. data/support/gems/rspec-core-2.11.1/spec/rspec/core/command_line_spec_output.txt +0 -0
  132. data/support/gems/rspec-core-2.11.1/spec/rspec/core/configuration_options_spec.rb +377 -0
  133. data/support/gems/rspec-core-2.11.1/spec/rspec/core/configuration_spec.rb +1196 -0
  134. data/support/gems/rspec-core-2.11.1/spec/rspec/core/deprecations_spec.rb +66 -0
  135. data/support/gems/rspec-core-2.11.1/spec/rspec/core/drb_command_line_spec.rb +108 -0
  136. data/support/gems/rspec-core-2.11.1/spec/rspec/core/drb_options_spec.rb +180 -0
  137. data/support/gems/rspec-core-2.11.1/spec/rspec/core/dsl_spec.rb +17 -0
  138. data/support/gems/rspec-core-2.11.1/spec/rspec/core/example_group_spec.rb +1098 -0
  139. data/support/gems/rspec-core-2.11.1/spec/rspec/core/example_spec.rb +370 -0
  140. data/support/gems/rspec-core-2.11.1/spec/rspec/core/filter_manager_spec.rb +256 -0
  141. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/base_formatter_spec.rb +80 -0
  142. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/base_text_formatter_spec.rb +363 -0
  143. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/documentation_formatter_spec.rb +88 -0
  144. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/helpers_spec.rb +66 -0
  145. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +410 -0
  146. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.8.7.html +409 -0
  147. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.9.2.html +416 -0
  148. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.9.3.html +416 -0
  149. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatter_spec.rb +82 -0
  150. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
  151. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
  152. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +410 -0
  153. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +409 -0
  154. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +416 -0
  155. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +416 -0
  156. data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatter_spec.rb +83 -0
  157. data/support/gems/rspec-core-2.11.1/spec/rspec/core/hooks_filtering_spec.rb +227 -0
  158. data/support/gems/rspec-core-2.11.1/spec/rspec/core/hooks_spec.rb +250 -0
  159. data/support/gems/rspec-core-2.11.1/spec/rspec/core/kernel_extensions_spec.rb +9 -0
  160. data/support/gems/rspec-core-2.11.1/spec/rspec/core/let_spec.rb +55 -0
  161. data/support/gems/rspec-core-2.11.1/spec/rspec/core/metadata_spec.rb +447 -0
  162. data/support/gems/rspec-core-2.11.1/spec/rspec/core/option_parser_spec.rb +166 -0
  163. data/support/gems/rspec-core-2.11.1/spec/rspec/core/pending_example_spec.rb +220 -0
  164. data/support/gems/rspec-core-2.11.1/spec/rspec/core/project_initializer_spec.rb +130 -0
  165. data/support/gems/rspec-core-2.11.1/spec/rspec/core/rake_task_spec.rb +138 -0
  166. data/support/gems/rspec-core-2.11.1/spec/rspec/core/reporter_spec.rb +103 -0
  167. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_bar.rb +0 -0
  168. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_foo.rb +0 -0
  169. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_spec.rb +1 -0
  170. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
  171. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/formatter_specs.rb +60 -0
  172. data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/utf8_encoded.rb +8 -0
  173. data/support/gems/rspec-core-2.11.1/spec/rspec/core/rspec_matchers_spec.rb +45 -0
  174. data/support/gems/rspec-core-2.11.1/spec/rspec/core/ruby_project_spec.rb +24 -0
  175. data/support/gems/rspec-core-2.11.1/spec/rspec/core/runner_spec.rb +81 -0
  176. data/support/gems/rspec-core-2.11.1/spec/rspec/core/shared_context_spec.rb +67 -0
  177. data/support/gems/rspec-core-2.11.1/spec/rspec/core/shared_example_group_spec.rb +84 -0
  178. data/support/gems/rspec-core-2.11.1/spec/rspec/core/subject_spec.rb +244 -0
  179. data/support/gems/rspec-core-2.11.1/spec/rspec/core/world_spec.rb +144 -0
  180. data/support/gems/rspec-core-2.11.1/spec/rspec/core_spec.rb +35 -0
  181. data/support/gems/rspec-core-2.11.1/spec/spec_helper.rb +98 -0
  182. data/support/gems/rspec-core-2.11.1/spec/support/config_options_helper.rb +24 -0
  183. data/support/gems/rspec-core-2.11.1/spec/support/helper_methods.rb +5 -0
  184. data/support/gems/rspec-core-2.11.1/spec/support/matchers.rb +65 -0
  185. data/support/gems/rspec-core-2.11.1/spec/support/shared_example_groups.rb +41 -0
  186. data/support/gems/rspec-core-2.11.1/spec/support/spec_files.rb +44 -0
  187. data/support/gems/rspec-expectations-2.11.2/.document +5 -0
  188. data/support/gems/rspec-expectations-2.11.2/.yardopts +6 -0
  189. data/support/gems/rspec-expectations-2.11.2/Changelog.md +246 -0
  190. data/support/gems/rspec-expectations-2.11.2/License.txt +23 -0
  191. data/support/gems/rspec-expectations-2.11.2/README.md +224 -0
  192. data/support/gems/rspec-expectations-2.11.2/features/README.md +49 -0
  193. data/support/gems/rspec-expectations-2.11.2/features/Upgrade.md +53 -0
  194. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/README.md +90 -0
  195. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/be.feature +173 -0
  196. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/be_within.feature +46 -0
  197. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/cover.feature +45 -0
  198. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/end_with.feature +46 -0
  199. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/equality.feature +145 -0
  200. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/exist.feature +43 -0
  201. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/expect_change.feature +59 -0
  202. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/expect_error.feature +138 -0
  203. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/have.feature +103 -0
  204. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/include.feature +121 -0
  205. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/match.feature +50 -0
  206. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/operators.feature +221 -0
  207. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/predicates.feature +128 -0
  208. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/respond_to.feature +78 -0
  209. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/satisfy.feature +31 -0
  210. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/start_with.feature +46 -0
  211. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/throw_symbol.feature +85 -0
  212. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/types.feature +114 -0
  213. data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/yield.feature +146 -0
  214. data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/access_running_example.feature +53 -0
  215. data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_diffable_matcher.feature +27 -0
  216. data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher.feature +340 -0
  217. data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
  218. data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
  219. data/support/gems/rspec-expectations-2.11.2/features/customized_message.feature +22 -0
  220. data/support/gems/rspec-expectations-2.11.2/features/diffing.feature +85 -0
  221. data/support/gems/rspec-expectations-2.11.2/features/implicit_docstrings.feature +52 -0
  222. data/support/gems/rspec-expectations-2.11.2/features/step_definitions/additional_cli_steps.rb +22 -0
  223. data/support/gems/rspec-expectations-2.11.2/features/support/env.rb +5 -0
  224. data/support/gems/rspec-expectations-2.11.2/features/syntax_configuration.feature +68 -0
  225. data/support/gems/rspec-expectations-2.11.2/features/test_frameworks/test_unit.feature +46 -0
  226. data/support/gems/rspec-expectations-2.11.2/lib/rspec-expectations.rb +1 -0
  227. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations.rb +47 -0
  228. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/deprecation.rb +38 -0
  229. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/differ.rb +81 -0
  230. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/errors.rb +9 -0
  231. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/expectation_target.rb +58 -0
  232. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions.rb +2 -0
  233. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions/array.rb +9 -0
  234. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions/object.rb +39 -0
  235. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/fail_with.rb +55 -0
  236. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/handler.rb +48 -0
  237. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/syntax.rb +110 -0
  238. data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/version.rb +8 -0
  239. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers.rb +689 -0
  240. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/be_close.rb +9 -0
  241. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in.rb +39 -0
  242. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/base_matcher.rb +68 -0
  243. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be.rb +185 -0
  244. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_instance_of.rb +11 -0
  245. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_kind_of.rb +11 -0
  246. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_within.rb +45 -0
  247. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/change.rb +132 -0
  248. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/cover.rb +21 -0
  249. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/eq.rb +22 -0
  250. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/eql.rb +23 -0
  251. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/equal.rb +44 -0
  252. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/exist.rb +26 -0
  253. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/has.rb +47 -0
  254. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/have.rb +107 -0
  255. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/include.rb +51 -0
  256. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/match.rb +12 -0
  257. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/match_array.rb +45 -0
  258. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/raise_error.rb +96 -0
  259. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/respond_to.rb +73 -0
  260. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/satisfy.rb +29 -0
  261. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/start_and_end_with.rb +48 -0
  262. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/throw_symbol.rb +93 -0
  263. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/yield.rb +219 -0
  264. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/compatibility.rb +14 -0
  265. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/configuration.rb +66 -0
  266. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/dsl.rb +24 -0
  267. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
  268. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/generated_descriptions.rb +36 -0
  269. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/matcher.rb +299 -0
  270. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/method_missing.rb +12 -0
  271. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/operator_matcher.rb +84 -0
  272. data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/pretty.rb +60 -0
  273. data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/differ_spec.rb +153 -0
  274. data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/expectation_target_spec.rb +65 -0
  275. data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/extensions/kernel_spec.rb +67 -0
  276. data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/fail_with_spec.rb +70 -0
  277. data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/handler_spec.rb +206 -0
  278. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/base_matcher_spec.rb +60 -0
  279. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_close_spec.rb +22 -0
  280. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
  281. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
  282. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_spec.rb +452 -0
  283. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_within_spec.rb +76 -0
  284. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/change_spec.rb +522 -0
  285. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/configuration_spec.rb +160 -0
  286. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/cover_spec.rb +65 -0
  287. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/description_generation_spec.rb +176 -0
  288. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/dsl_spec.rb +57 -0
  289. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/eq_spec.rb +50 -0
  290. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/eql_spec.rb +37 -0
  291. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/equal_spec.rb +57 -0
  292. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/exist_spec.rb +104 -0
  293. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/has_spec.rb +113 -0
  294. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/have_spec.rb +458 -0
  295. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/include_spec.rb +363 -0
  296. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/match_array_spec.rb +120 -0
  297. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/match_spec.rb +57 -0
  298. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/matcher_spec.rb +434 -0
  299. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/matchers_spec.rb +31 -0
  300. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/method_missing_spec.rb +24 -0
  301. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/operator_matcher_spec.rb +221 -0
  302. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/raise_error_spec.rb +339 -0
  303. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/respond_to_spec.rb +292 -0
  304. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/satisfy_spec.rb +40 -0
  305. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/start_with_end_with_spec.rb +174 -0
  306. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/throw_symbol_spec.rb +111 -0
  307. data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/yield_spec.rb +374 -0
  308. data/support/gems/rspec-expectations-2.11.2/spec/spec_helper.rb +27 -0
  309. data/support/gems/rspec-expectations-2.11.2/spec/support/classes.rb +56 -0
  310. data/support/gems/rspec-expectations-2.11.2/spec/support/in_sub_process.rb +31 -0
  311. data/support/gems/rspec-expectations-2.11.2/spec/support/matchers.rb +22 -0
  312. data/support/gems/rspec-expectations-2.11.2/spec/support/ruby_version.rb +10 -0
  313. data/support/gems/rspec-mocks-2.11.1/.document +5 -0
  314. data/support/gems/rspec-mocks-2.11.1/.yardopts +6 -0
  315. data/support/gems/rspec-mocks-2.11.1/Changelog.md +199 -0
  316. data/support/gems/rspec-mocks-2.11.1/License.txt +23 -0
  317. data/support/gems/rspec-mocks-2.11.1/README.md +276 -0
  318. data/support/gems/rspec-mocks-2.11.1/features/README.md +67 -0
  319. data/support/gems/rspec-mocks-2.11.1/features/Scope.md +17 -0
  320. data/support/gems/rspec-mocks-2.11.1/features/Upgrade.md +22 -0
  321. data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/README.md +27 -0
  322. data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/explicit.feature +60 -0
  323. data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/general_matchers.feature +85 -0
  324. data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/type_matchers.feature +25 -0
  325. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/README.md +58 -0
  326. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/any_instance.feature +21 -0
  327. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/block_local_expectations.feature.pending +55 -0
  328. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/expect_message.feature +94 -0
  329. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/receive_counts.feature +209 -0
  330. data/support/gems/rspec-mocks-2.11.1/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
  331. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/README.md +43 -0
  332. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/any_instance.feature +133 -0
  333. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/as_null_object.feature +35 -0
  334. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/simple_return_value.feature +64 -0
  335. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/stub_chain.feature +51 -0
  336. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/stub_implementation.feature +26 -0
  337. data/support/gems/rspec-mocks-2.11.1/features/method_stubs/to_ary.feature +47 -0
  338. data/support/gems/rspec-mocks-2.11.1/features/outside_rspec/configuration.feature +82 -0
  339. data/support/gems/rspec-mocks-2.11.1/features/outside_rspec/standalone.feature +32 -0
  340. data/support/gems/rspec-mocks-2.11.1/features/step_definitions/additional_cli_steps.rb +4 -0
  341. data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/README.md +62 -0
  342. data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/stub_defined_constant.feature +79 -0
  343. data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/stub_undefined_constant.feature +50 -0
  344. data/support/gems/rspec-mocks-2.11.1/features/support/env.rb +6 -0
  345. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks.rb +39 -0
  346. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance.rb +81 -0
  347. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/chain.rb +77 -0
  348. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/expectation_chain.rb +57 -0
  349. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/message_chains.rb +60 -0
  350. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/recorder.rb +197 -0
  351. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/stub_chain.rb +37 -0
  352. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +25 -0
  353. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/argument_list_matcher.rb +93 -0
  354. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/argument_matchers.rb +238 -0
  355. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/error_generator.rb +114 -0
  356. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/errors.rb +12 -0
  357. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/example_methods.rb +95 -0
  358. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/instance_exec.rb +34 -0
  359. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/marshal.rb +23 -0
  360. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/psych.rb +23 -0
  361. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/framework.rb +20 -0
  362. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/message_expectation.rb +488 -0
  363. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/method_double.rb +196 -0
  364. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/methods.rb +155 -0
  365. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/mock.rb +7 -0
  366. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/order_group.rb +40 -0
  367. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/proxy.rb +190 -0
  368. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/serialization.rb +34 -0
  369. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/space.rb +34 -0
  370. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/standalone.rb +3 -0
  371. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/stub_const.rb +280 -0
  372. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/test_double.rb +103 -0
  373. data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/version.rb +7 -0
  374. data/support/gems/rspec-mocks-2.11.1/lib/spec/mocks.rb +2 -0
  375. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/and_yield_spec.rb +114 -0
  376. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
  377. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_instance_spec.rb +825 -0
  378. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_number_of_times_spec.rb +30 -0
  379. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/argument_expectation_spec.rb +34 -0
  380. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/at_least_spec.rb +142 -0
  381. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/at_most_spec.rb +90 -0
  382. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/block_return_value_spec.rb +53 -0
  383. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
  384. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_10263_spec.rb +25 -0
  385. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
  386. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
  387. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
  388. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
  389. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
  390. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
  391. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
  392. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/double_spec.rb +12 -0
  393. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/failing_argument_matchers_spec.rb +95 -0
  394. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/hash_excluding_matcher_spec.rb +67 -0
  395. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
  396. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_ordering_spec.rb +103 -0
  397. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_space_spec.rb +58 -0
  398. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_spec.rb +730 -0
  399. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/multiple_return_value_spec.rb +119 -0
  400. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/nil_expectation_warning_spec.rb +62 -0
  401. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/null_object_mock_spec.rb +106 -0
  402. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/once_counts_spec.rb +52 -0
  403. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/options_hash_spec.rb +35 -0
  404. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/partial_mock_spec.rb +156 -0
  405. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
  406. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
  407. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/precise_counts_spec.rb +68 -0
  408. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/record_messages_spec.rb +26 -0
  409. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/serialization_spec.rb +111 -0
  410. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stash_spec.rb +27 -0
  411. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_chain_spec.rb +149 -0
  412. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_const_spec.rb +309 -0
  413. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
  414. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_spec.rb +238 -0
  415. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stubbed_message_expectations_spec.rb +47 -0
  416. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/test_double_spec.rb +57 -0
  417. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/to_ary_spec.rb +40 -0
  418. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/twice_counts_spec.rb +66 -0
  419. data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks_spec.rb +51 -0
  420. data/support/gems/rspec-mocks-2.11.1/spec/spec_helper.rb +15 -0
  421. data/support/gems/rspec-rails-2.11.0/.document +5 -0
  422. data/support/gems/rspec-rails-2.11.0/.yardopts +8 -0
  423. data/support/gems/rspec-rails-2.11.0/Changelog.md +293 -0
  424. data/support/gems/rspec-rails-2.11.0/License.txt +22 -0
  425. data/support/gems/rspec-rails-2.11.0/README.md +494 -0
  426. data/support/gems/rspec-rails-2.11.0/features/Autotest.md +24 -0
  427. data/support/gems/rspec-rails-2.11.0/features/Generators.md +8 -0
  428. data/support/gems/rspec-rails-2.11.0/features/GettingStarted.md +84 -0
  429. data/support/gems/rspec-rails-2.11.0/features/README.md +56 -0
  430. data/support/gems/rspec-rails-2.11.0/features/RailsVersions.md +4 -0
  431. data/support/gems/rspec-rails-2.11.0/features/Transactions.md +84 -0
  432. data/support/gems/rspec-rails-2.11.0/features/Upgrade.md +117 -0
  433. data/support/gems/rspec-rails-2.11.0/features/controller_specs/Cookies.md +57 -0
  434. data/support/gems/rspec-rails-2.11.0/features/controller_specs/README.md +45 -0
  435. data/support/gems/rspec-rails-2.11.0/features/controller_specs/anonymous_controller.feature +330 -0
  436. data/support/gems/rspec-rails-2.11.0/features/controller_specs/bypass_rescue.feature +75 -0
  437. data/support/gems/rspec-rails-2.11.0/features/controller_specs/controller_spec.feature +35 -0
  438. data/support/gems/rspec-rails-2.11.0/features/controller_specs/isolation_from_views.feature +87 -0
  439. data/support/gems/rspec-rails-2.11.0/features/controller_specs/render_views.feature +114 -0
  440. data/support/gems/rspec-rails-2.11.0/features/helper_specs/helper_spec.feature +96 -0
  441. data/support/gems/rspec-rails-2.11.0/features/mailer_specs/url_helpers.feature +38 -0
  442. data/support/gems/rspec-rails-2.11.0/features/matchers/README.md +18 -0
  443. data/support/gems/rspec-rails-2.11.0/features/matchers/new_record_matcher.feature +28 -0
  444. data/support/gems/rspec-rails-2.11.0/features/matchers/redirect_to_matcher.feature +40 -0
  445. data/support/gems/rspec-rails-2.11.0/features/matchers/relation_match_array.feature +20 -0
  446. data/support/gems/rspec-rails-2.11.0/features/matchers/render_template_matcher.feature +28 -0
  447. data/support/gems/rspec-rails-2.11.0/features/mocks/mock_model.feature +147 -0
  448. data/support/gems/rspec-rails-2.11.0/features/mocks/stub_model.feature +58 -0
  449. data/support/gems/rspec-rails-2.11.0/features/model_specs/README.md +21 -0
  450. data/support/gems/rspec-rails-2.11.0/features/model_specs/errors_on.feature +33 -0
  451. data/support/gems/rspec-rails-2.11.0/features/model_specs/transactional_examples.feature +109 -0
  452. data/support/gems/rspec-rails-2.11.0/features/request_specs/request_spec.feature +49 -0
  453. data/support/gems/rspec-rails-2.11.0/features/routing_specs/README.md +17 -0
  454. data/support/gems/rspec-rails-2.11.0/features/routing_specs/be_routable_matcher.feature +80 -0
  455. data/support/gems/rspec-rails-2.11.0/features/routing_specs/named_routes.feature +18 -0
  456. data/support/gems/rspec-rails-2.11.0/features/routing_specs/route_to_matcher.feature +90 -0
  457. data/support/gems/rspec-rails-2.11.0/features/step_definitions/additional_cli_steps.rb +4 -0
  458. data/support/gems/rspec-rails-2.11.0/features/step_definitions/model_steps.rb +3 -0
  459. data/support/gems/rspec-rails-2.11.0/features/support/env.rb +53 -0
  460. data/support/gems/rspec-rails-2.11.0/features/view_specs/inferred_controller_path.feature +44 -0
  461. data/support/gems/rspec-rails-2.11.0/features/view_specs/stub_template.feature +51 -0
  462. data/support/gems/rspec-rails-2.11.0/features/view_specs/view_spec.feature +174 -0
  463. data/support/gems/rspec-rails-2.11.0/lib/autotest/rails_rspec2.rb +84 -0
  464. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec.rb +25 -0
  465. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/controller_generator.rb +33 -0
  466. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/templates/controller_spec.rb +14 -0
  467. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/templates/view_spec.rb +5 -0
  468. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/helper/helper_generator.rb +15 -0
  469. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/helper/templates/helper_spec.rb +15 -0
  470. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/install_generator.rb +24 -0
  471. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/templates/.rspec +1 -0
  472. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/templates/spec/spec_helper.rb +38 -0
  473. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/integration/integration_generator.rb +27 -0
  474. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/integration/templates/request_spec.rb +15 -0
  475. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/mailer_generator.rb +20 -0
  476. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/templates/fixture +3 -0
  477. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/templates/mailer_spec.rb +23 -0
  478. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/model_generator.rb +22 -0
  479. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/templates/fixtures.yml +19 -0
  480. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/templates/model_spec.rb +5 -0
  481. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/observer/observer_generator.rb +12 -0
  482. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/observer/templates/observer_spec.rb +5 -0
  483. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/scaffold_generator.rb +158 -0
  484. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/controller_spec.rb +166 -0
  485. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/edit_spec.rb +31 -0
  486. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/index_spec.rb +32 -0
  487. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/new_spec.rb +30 -0
  488. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/routing_spec.rb +37 -0
  489. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/show_spec.rb +28 -0
  490. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/view/templates/view_spec.rb +5 -0
  491. data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/view/view_generator.rb +21 -0
  492. data/support/gems/rspec-rails-2.11.0/lib/rspec-rails.rb +14 -0
  493. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails.rb +17 -0
  494. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/adapters.rb +79 -0
  495. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example.rb +38 -0
  496. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/controller_example_group.rb +128 -0
  497. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/helper_example_group.rb +40 -0
  498. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/mailer_example_group.rb +22 -0
  499. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/model_example_group.rb +10 -0
  500. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/rails_example_group.rb +14 -0
  501. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/request_example_group.rb +23 -0
  502. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/routing_example_group.rb +27 -0
  503. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/view_example_group.rb +155 -0
  504. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/extensions.rb +1 -0
  505. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/extensions/active_record/base.rb +45 -0
  506. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/fixture_support.rb +40 -0
  507. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers.rb +26 -0
  508. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/be_a_new.rb +76 -0
  509. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/be_new_record.rb +19 -0
  510. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/have_extension.rb +35 -0
  511. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/have_rendered.rb +40 -0
  512. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/redirect_to.rb +37 -0
  513. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/relation_match_array.rb +3 -0
  514. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/routing_matchers.rb +107 -0
  515. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/mocks.rb +243 -0
  516. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/module_inclusion.rb +29 -0
  517. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/tasks/rspec.rake +56 -0
  518. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/vendor/capybara.rb +29 -0
  519. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/vendor/webrat.rb +33 -0
  520. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/version.rb +7 -0
  521. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/view_assigns.rb +45 -0
  522. data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/view_rendering.rb +121 -0
  523. data/support/gems/rspec-rails-2.11.0/spec/autotest/rails_rspec2_spec.rb +36 -0
  524. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/controller/controller_generator_spec.rb +86 -0
  525. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/helper/helper_generator_spec.rb +30 -0
  526. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/install/install_generator_spec.rb +18 -0
  527. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/integration/integration_generator_spec.rb +44 -0
  528. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/mailer/mailer_generator_spec.rb +48 -0
  529. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/model/model_generator_spec.rb +52 -0
  530. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/observer/observer_generator_spec.rb +21 -0
  531. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +107 -0
  532. data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/view/view_generator_spec.rb +41 -0
  533. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/assertion_adapter_spec.rb +28 -0
  534. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/configuration_spec.rb +26 -0
  535. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/deprecations_spec.rb +18 -0
  536. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/controller_example_group_spec.rb +100 -0
  537. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/helper_example_group_spec.rb +64 -0
  538. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/mailer_example_group_spec.rb +21 -0
  539. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/model_example_group_spec.rb +15 -0
  540. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/request_example_group_spec.rb +17 -0
  541. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/routing_example_group_spec.rb +32 -0
  542. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/view_example_group_spec.rb +214 -0
  543. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +23 -0
  544. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/extensions/active_record/records_spec.rb +9 -0
  545. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/fixture_support_spec.rb +17 -0
  546. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_a_new_spec.rb +142 -0
  547. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_new_record_spec.rb +19 -0
  548. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_routable_spec.rb +41 -0
  549. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/errors_on_spec.rb +38 -0
  550. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/have_rendered_spec.rb +93 -0
  551. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/redirect_to_spec.rb +80 -0
  552. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/relation_match_array_spec.rb +20 -0
  553. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/route_to_spec.rb +152 -0
  554. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/mocks/mock_model_spec.rb +379 -0
  555. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/mocks/stub_model_spec.rb +154 -0
  556. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +32 -0
  557. data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/view_rendering_spec.rb +111 -0
  558. data/support/gems/rspec-rails-2.11.0/spec/spec_helper.rb +31 -0
  559. data/support/gems/rspec-rails-2.11.0/spec/support/ar_classes.rb +42 -0
  560. data/support/gems/rspec-rails-2.11.0/spec/support/helpers.rb +20 -0
  561. data/support/gems/rspec-rails-2.11.0/spec/support/matchers.rb +9 -0
  562. data/support/specifications/rspec-2.11.0.gemspec +39 -0
  563. data/support/specifications/rspec-core-2.11.1.gemspec +61 -0
  564. data/support/specifications/rspec-expectations-2.11.2.gemspec +40 -0
  565. data/support/specifications/rspec-mocks-2.11.1.gemspec +37 -0
  566. data/support/specifications/rspec-rails-2.11.0.gemspec +55 -0
  567. metadata +653 -0
@@ -0,0 +1,66 @@
1
+ require "spec_helper"
2
+
3
+ describe "deprecations" do
4
+ describe "Spec" do
5
+ it "is deprecated" do
6
+ RSpec.should_receive(:warn_deprecation).with(/Spec .* RSpec/i)
7
+ Spec
8
+ end
9
+
10
+ it "returns RSpec" do
11
+ RSpec.stub(:warn_deprecation)
12
+ Spec.should eq(RSpec)
13
+ end
14
+
15
+ it "doesn't include backward compatibility in const_missing backtrace" do
16
+ RSpec.stub(:warn_deprecation)
17
+ exception = nil
18
+ begin
19
+ ConstantThatDoesNotExist
20
+ rescue Exception => exception
21
+ end
22
+ exception.backtrace.find { |l| l =~ /lib\/rspec\/core\/backward_compatibility/ }.should be_nil
23
+ end
24
+ end
25
+
26
+ describe RSpec::Core::ExampleGroup do
27
+ describe 'running_example' do
28
+ it 'is deprecated' do
29
+ RSpec.should_receive(:warn_deprecation)
30
+ self.running_example
31
+ end
32
+
33
+ it "delegates to example" do
34
+ RSpec.stub(:warn_deprecation)
35
+ running_example.should eq(example)
36
+ end
37
+ end
38
+ end
39
+
40
+ describe "Spec::Runner.configure" do
41
+ it "is deprecated" do
42
+ RSpec.stub(:warn_deprecation)
43
+ RSpec.should_receive(:deprecate)
44
+ Spec::Runner.configure
45
+ end
46
+ end
47
+
48
+ describe "Spec::Rake::SpecTask" do
49
+ it "is deprecated" do
50
+ RSpec.stub(:warn_deprecation)
51
+ RSpec.should_receive(:deprecate)
52
+ Spec::Rake::SpecTask
53
+ end
54
+
55
+ it "doesn't include backward compatibility in const_missing backtrace" do
56
+ RSpec.stub(:warn_deprecation)
57
+ exception = nil
58
+ begin
59
+ Spec::Rake::ConstantThatDoesNotExist
60
+ rescue Exception => exception
61
+ end
62
+ exception.backtrace.find { |l| l =~ /lib\/rspec\/core\/backward_compatibility/ }.should be_nil
63
+ end
64
+ end
65
+
66
+ end
@@ -0,0 +1,108 @@
1
+ require "spec_helper"
2
+ require 'rspec/core/drb_command_line'
3
+
4
+ describe "::DRbCommandLine", :type => :drb, :unless => RUBY_PLATFORM == 'java' do
5
+ let(:config) { RSpec::Core::Configuration.new }
6
+ let(:out) { StringIO.new }
7
+ let(:err) { StringIO.new }
8
+
9
+ include_context "spec files"
10
+
11
+ def command_line(*args)
12
+ RSpec::Core::DRbCommandLine.new(config_options(*args))
13
+ end
14
+
15
+ def config_options(*args)
16
+ options = RSpec::Core::ConfigurationOptions.new(args)
17
+ options.parse_options
18
+ options
19
+ end
20
+
21
+ context "without server running" do
22
+ it "raises an error" do
23
+ lambda { command_line.run(err, out) }.should raise_error(DRb::DRbConnError)
24
+ end
25
+ end
26
+
27
+ describe "--drb-port" do
28
+ def with_RSPEC_DRB_set_to(val)
29
+ original = ENV['RSPEC_DRB']
30
+ ENV['RSPEC_DRB'] = val
31
+ begin
32
+ yield
33
+ ensure
34
+ ENV['RSPEC_DRB'] = original
35
+ end
36
+ end
37
+
38
+ context "without RSPEC_DRB environment variable set" do
39
+ it "defaults to 8989" do
40
+ with_RSPEC_DRB_set_to(nil) do
41
+ command_line.drb_port.should eq(8989)
42
+ end
43
+ end
44
+
45
+ it "sets the DRb port" do
46
+ with_RSPEC_DRB_set_to(nil) do
47
+ command_line("--drb-port", "1234").drb_port.should eq(1234)
48
+ command_line("--drb-port", "5678").drb_port.should eq(5678)
49
+ end
50
+ end
51
+ end
52
+
53
+ context "with RSPEC_DRB environment variable set" do
54
+ context "without config variable set" do
55
+ it "uses RSPEC_DRB value" do
56
+ with_RSPEC_DRB_set_to('9000') do
57
+ command_line.drb_port.should eq("9000")
58
+ end
59
+ end
60
+ end
61
+
62
+ context "and config variable set" do
63
+ it "uses configured value" do
64
+ with_RSPEC_DRB_set_to('9000') do
65
+ command_line(*%w[--drb-port 5678]).drb_port.should eq(5678)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+
72
+ context "with server running" do
73
+ class SimpleDRbSpecServer
74
+ def self.run(argv, err, out)
75
+ options = RSpec::Core::ConfigurationOptions.new(argv)
76
+ options.parse_options
77
+ RSpec::Core::CommandLine.new(options, RSpec::Core::Configuration.new).run(err, out)
78
+ end
79
+ end
80
+
81
+ before(:all) do
82
+ @drb_port = '8990'
83
+ @drb_example_file_counter = 0
84
+ DRb::start_service("druby://127.0.0.1:#{@drb_port}", SimpleDRbSpecServer)
85
+ end
86
+
87
+ after(:all) do
88
+ DRb::stop_service
89
+ end
90
+
91
+ it "returns 0 if spec passes" do
92
+ result = command_line("--drb-port", @drb_port, passing_spec_filename).run(err, out)
93
+ result.should be(0)
94
+ end
95
+
96
+ it "returns 1 if spec fails" do
97
+ result = command_line("--drb-port", @drb_port, failing_spec_filename).run(err, out)
98
+ result.should be(1)
99
+ end
100
+
101
+ it "outputs colorized text when running with --colour option" do
102
+ pending "figure out a way to tell the output to say it's tty"
103
+ command_line(failing_spec_filename, "--color", "--drb-port", @drb_port).run(err, out)
104
+ out.rewind
105
+ out.read.should =~ /\e\[31m/m
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,180 @@
1
+ require "spec_helper"
2
+ require 'rspec/core/drb_options'
3
+
4
+ describe RSpec::Core::DrbOptions, :fakefs do
5
+ include ConfigOptionsHelper
6
+
7
+ describe "#drb_argv" do
8
+ it "preserves extra arguments" do
9
+ File.stub(:exist?) { false }
10
+ config_options_object(*%w[ a --drb b --color c ]).drb_argv.should =~ %w[ --color a b c ]
11
+ end
12
+
13
+ %w(--color --fail-fast --profile --backtrace --tty).each do |option|
14
+ it "includes #{option}" do
15
+ config_options_object("#{option}").drb_argv.should include("#{option}")
16
+ end
17
+ end
18
+
19
+ it "includes --failure-exit-code" do
20
+ config_options_object(*%w[--failure-exit-code 2]).drb_argv.should include("--failure-exit-code", "2")
21
+ end
22
+
23
+ it "includes --options" do
24
+ config_options_object(*%w[--options custom.opts]).drb_argv.should include("--options", "custom.opts")
25
+ end
26
+
27
+ it "includes --order" do
28
+ config_options_object(*%w[--order random]).drb_argv.should include('--order', 'random')
29
+ end
30
+
31
+ context "with --example" do
32
+ it "includes --example" do
33
+ config_options_object(*%w[--example foo]).drb_argv.should include("--example", "foo")
34
+ end
35
+
36
+ it "unescapes characters which were escaped upon storing --example originally" do
37
+ config_options_object("--example", "foo\\ bar").drb_argv.should include("--example", "foo bar")
38
+ end
39
+ end
40
+
41
+ context "with tags" do
42
+ it "includes the inclusion tags" do
43
+ coo = config_options_object("--tag", "tag")
44
+ coo.drb_argv.should eq(["--tag", "tag"])
45
+ end
46
+
47
+ it "includes the inclusion tags with values" do
48
+ coo = config_options_object("--tag", "tag:foo")
49
+ coo.drb_argv.should eq(["--tag", "tag:foo"])
50
+ end
51
+
52
+ it "leaves inclusion tags intact" do
53
+ coo = config_options_object("--tag", "tag")
54
+ coo.drb_argv
55
+ coo.filter_manager.inclusions.should eq( {:tag=>true} )
56
+ end
57
+
58
+ it "leaves inclusion tags with values intact" do
59
+ coo = config_options_object("--tag", "tag:foo")
60
+ coo.drb_argv
61
+ coo.filter_manager.inclusions.should eq( {:tag=>'foo'} )
62
+ end
63
+
64
+ it "includes the exclusion tags" do
65
+ coo = config_options_object("--tag", "~tag")
66
+ coo.drb_argv.should eq(["--tag", "~tag"])
67
+ end
68
+
69
+ it "includes the exclusion tags with values" do
70
+ coo = config_options_object("--tag", "~tag:foo")
71
+ coo.drb_argv.should eq(["--tag", "~tag:foo"])
72
+ end
73
+
74
+ it "leaves exclusion tags intact" do
75
+ coo = config_options_object("--tag", "~tag")
76
+ coo.drb_argv
77
+ coo.filter_manager.exclusions.should include(:tag=>true)
78
+ end
79
+
80
+ it "leaves exclusion tags with values intact" do
81
+ coo = config_options_object("--tag", "~tag:foo")
82
+ coo.drb_argv
83
+ coo.filter_manager.exclusions.should include(:tag=>'foo')
84
+ end
85
+ end
86
+
87
+ context "with formatters" do
88
+ it "includes the formatters" do
89
+ coo = config_options_object("--format", "d")
90
+ coo.drb_argv.should eq(["--format", "d"])
91
+ end
92
+
93
+ it "leaves formatters intact" do
94
+ coo = config_options_object("--format", "d")
95
+ coo.drb_argv
96
+ coo.options[:formatters].should eq([["d"]])
97
+ end
98
+
99
+ it "leaves output intact" do
100
+ coo = config_options_object("--format", "p", "--out", "foo.txt", "--format", "d")
101
+ coo.drb_argv
102
+ coo.options[:formatters].should eq([["p","foo.txt"],["d"]])
103
+ end
104
+ end
105
+
106
+ context "with --out" do
107
+ it "combines with formatters" do
108
+ coo = config_options_object(*%w[--format h --out report.html])
109
+ coo.drb_argv.should eq(%w[--format h --out report.html])
110
+ end
111
+ end
112
+
113
+ context "with --line_number" do
114
+ it "includes --line_number" do
115
+ config_options_object(*%w[--line_number 35]).drb_argv.should eq(%w[--line_number 35])
116
+ end
117
+
118
+ it "includes multiple lines" do
119
+ config_options_object(*%w[-l 90 -l 4 -l 55]).drb_argv.should eq(
120
+ %w[--line_number 90 --line_number 4 --line_number 55]
121
+ )
122
+ end
123
+ end
124
+
125
+ context "with -I libs" do
126
+ it "includes -I" do
127
+ config_options_object(*%w[-I a_dir]).drb_argv.should eq(%w[-I a_dir])
128
+ end
129
+
130
+ it "includes multiple paths" do
131
+ config_options_object(*%w[-I dir_1 -I dir_2 -I dir_3]).drb_argv.should eq(
132
+ %w[-I dir_1 -I dir_2 -I dir_3]
133
+ )
134
+ end
135
+ end
136
+
137
+ context "with --require" do
138
+ it "includes --require" do
139
+ config_options_object(*%w[--require a_path]).drb_argv.should eq(%w[--require a_path])
140
+ end
141
+
142
+ it "includes multiple paths" do
143
+ config_options_object(*%w[--require dir/ --require file.rb]).drb_argv.should eq(
144
+ %w[--require dir/ --require file.rb]
145
+ )
146
+ end
147
+ end
148
+
149
+ context "--drb specified in ARGV" do
150
+ it "renders all the original arguments except --drb" do
151
+ config_options_object(*%w[ --drb --color --format s --example pattern --line_number 1 --profile --backtrace -I path/a -I path/b --require path/c --require path/d]).
152
+ drb_argv.should eq(%w[ --color --profile --backtrace --example pattern --line_number 1 --format s -I path/a -I path/b --require path/c --require path/d])
153
+ end
154
+ end
155
+
156
+ context "--drb specified in the options file" do
157
+ it "renders all the original arguments except --drb" do
158
+ File.open("./.rspec", "w") {|f| f << "--drb --color"}
159
+ config_options_object(*%w[ --tty --format s --example pattern --line_number 1 --profile --backtrace ]).
160
+ drb_argv.should eq(%w[ --color --profile --backtrace --tty --example pattern --line_number 1 --format s])
161
+ end
162
+ end
163
+
164
+ context "--drb specified in ARGV and the options file" do
165
+ it "renders all the original arguments except --drb" do
166
+ File.open("./.rspec", "w") {|f| f << "--drb --color"}
167
+ config_options_object(*%w[ --drb --format s --example pattern --line_number 1 --profile --backtrace]).
168
+ drb_argv.should eq(%w[ --color --profile --backtrace --example pattern --line_number 1 --format s])
169
+ end
170
+ end
171
+
172
+ context "--drb specified in ARGV and in as ARGV-specified --options file" do
173
+ it "renders all the original arguments except --drb and --options" do
174
+ File.open("./.rspec", "w") {|f| f << "--drb --color"}
175
+ config_options_object(*%w[ --drb --format s --example pattern --line_number 1 --profile --backtrace]).
176
+ drb_argv.should eq(%w[ --color --profile --backtrace --example pattern --line_number 1 --format s ])
177
+ end
178
+ end
179
+ end
180
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ main = self
4
+ describe "The describe method" do
5
+ it 'is available on the main object' do
6
+ main.should respond_to(:describe)
7
+ end
8
+
9
+ it 'is available on modules (so example groups can be nested inside them)' do
10
+ Module.new.should respond_to(:describe)
11
+ end
12
+
13
+ it 'is not available on other types of objects' do
14
+ Object.new.should_not respond_to(:describe)
15
+ end
16
+ end
17
+
@@ -0,0 +1,1098 @@
1
+ require 'spec_helper'
2
+
3
+ class SelfObserver
4
+ def self.cache
5
+ @cache ||= []
6
+ end
7
+
8
+ def initialize
9
+ self.class.cache << self
10
+ end
11
+ end
12
+
13
+ module RSpec::Core
14
+ describe ExampleGroup do
15
+ it_behaves_like "metadata hash builder" do
16
+ def metadata_hash(*args)
17
+ group = ExampleGroup.describe('example description', *args)
18
+ group.metadata
19
+ end
20
+ end
21
+
22
+ context 'when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false' do
23
+ before(:each) do
24
+ RSpec.configure { |c| c.treat_symbols_as_metadata_keys_with_true_values = false }
25
+ end
26
+
27
+ it 'processes string args as part of the description' do
28
+ group = ExampleGroup.describe("some", "separate", "strings")
29
+ group.description.should eq("some separate strings")
30
+ end
31
+
32
+ it 'processes symbol args as part of the description' do
33
+ Kernel.stub(:warn) # to silence Symbols as args warning
34
+ group = ExampleGroup.describe(:some, :separate, :symbols)
35
+ group.description.should eq("some separate symbols")
36
+ end
37
+ end
38
+
39
+ context 'when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true' do
40
+ let(:group) { ExampleGroup.describe(:symbol) }
41
+
42
+ before(:each) do
43
+ RSpec.configure { |c| c.treat_symbols_as_metadata_keys_with_true_values = true }
44
+ end
45
+
46
+ it 'does not treat the first argument as a metadata key even if it is a symbol' do
47
+ group.metadata.should_not include(:symbol)
48
+ end
49
+
50
+ it 'treats the first argument as part of the description when it is a symbol' do
51
+ group.description.should eq("symbol")
52
+ end
53
+ end
54
+
55
+ describe "top level group" do
56
+ it "runs its children" do
57
+ examples_run = []
58
+ group = ExampleGroup.describe("parent") do
59
+ describe("child") do
60
+ it "does something" do
61
+ examples_run << example
62
+ end
63
+ end
64
+ end
65
+
66
+ group.run
67
+ examples_run.should have(1).example
68
+ end
69
+
70
+ context "with a failure in the top level group" do
71
+ it "runs its children " do
72
+ examples_run = []
73
+ group = ExampleGroup.describe("parent") do
74
+ it "fails" do
75
+ examples_run << example
76
+ raise "fail"
77
+ end
78
+ describe("child") do
79
+ it "does something" do
80
+ examples_run << example
81
+ end
82
+ end
83
+ end
84
+
85
+ group.run
86
+ examples_run.should have(2).examples
87
+ end
88
+ end
89
+
90
+ describe "descendants" do
91
+ it "returns self + all descendants" do
92
+ group = ExampleGroup.describe("parent") do
93
+ describe("child") do
94
+ describe("grandchild 1") {}
95
+ describe("grandchild 2") {}
96
+ end
97
+ end
98
+ group.descendants.size.should eq(4)
99
+ end
100
+ end
101
+ end
102
+
103
+ describe "child" do
104
+ it "is known by parent" do
105
+ parent = ExampleGroup.describe
106
+ child = parent.describe
107
+ parent.children.should eq([child])
108
+ end
109
+
110
+ it "is not registered in world" do
111
+ world = RSpec::Core::World.new
112
+ parent = ExampleGroup.describe
113
+ world.register(parent)
114
+ parent.describe
115
+ world.example_groups.should eq([parent])
116
+ end
117
+ end
118
+
119
+ describe "filtering" do
120
+ let(:world) { World.new }
121
+
122
+ shared_examples "matching filters" do
123
+ context "inclusion" do
124
+ before do
125
+ filter_manager = FilterManager.new
126
+ filter_manager.include filter_metadata
127
+ world.stub(:filter_manager => filter_manager)
128
+ end
129
+
130
+ it "includes examples in groups matching filter" do
131
+ group = ExampleGroup.describe("does something", spec_metadata)
132
+ group.stub(:world) { world }
133
+ all_examples = [ group.example("first"), group.example("second") ]
134
+
135
+ group.filtered_examples.should eq(all_examples)
136
+ end
137
+
138
+ it "includes examples directly matching filter" do
139
+ group = ExampleGroup.describe("does something")
140
+ group.stub(:world) { world }
141
+ filtered_examples = [
142
+ group.example("first", spec_metadata),
143
+ group.example("second", spec_metadata)
144
+ ]
145
+ group.example("third (not-filtered)")
146
+
147
+ group.filtered_examples.should eq(filtered_examples)
148
+ end
149
+ end
150
+
151
+ context "exclusion" do
152
+ before do
153
+ filter_manager = FilterManager.new
154
+ filter_manager.exclude filter_metadata
155
+ world.stub(:filter_manager => filter_manager)
156
+ end
157
+
158
+ it "excludes examples in groups matching filter" do
159
+ group = ExampleGroup.describe("does something", spec_metadata)
160
+ group.stub(:world) { world }
161
+ [ group.example("first"), group.example("second") ]
162
+
163
+ group.filtered_examples.should be_empty
164
+ end
165
+
166
+ it "excludes examples directly matching filter" do
167
+ group = ExampleGroup.describe("does something")
168
+ group.stub(:world) { world }
169
+ [
170
+ group.example("first", spec_metadata),
171
+ group.example("second", spec_metadata)
172
+ ]
173
+ unfiltered_example = group.example("third (not-filtered)")
174
+
175
+ group.filtered_examples.should eq([unfiltered_example])
176
+ end
177
+ end
178
+ end
179
+
180
+ context "matching false" do
181
+ let(:spec_metadata) { { :awesome => false }}
182
+
183
+ context "against false" do
184
+ let(:filter_metadata) { { :awesome => false }}
185
+ include_examples "matching filters"
186
+ end
187
+
188
+ context "against 'false'" do
189
+ let(:filter_metadata) { { :awesome => 'false' }}
190
+ include_examples "matching filters"
191
+ end
192
+
193
+ context "against :false" do
194
+ let(:filter_metadata) { { :awesome => :false }}
195
+ include_examples "matching filters"
196
+ end
197
+ end
198
+
199
+ context "matching true" do
200
+ let(:spec_metadata) { { :awesome => true }}
201
+
202
+ context "against true" do
203
+ let(:filter_metadata) { { :awesome => true }}
204
+ include_examples "matching filters"
205
+ end
206
+
207
+ context "against 'true'" do
208
+ let(:filter_metadata) { { :awesome => 'true' }}
209
+ include_examples "matching filters"
210
+ end
211
+
212
+ context "against :true" do
213
+ let(:filter_metadata) { { :awesome => :true }}
214
+ include_examples "matching filters"
215
+ end
216
+ end
217
+
218
+ context "matching a string" do
219
+ let(:spec_metadata) { { :type => 'special' }}
220
+
221
+ context "against a string" do
222
+ let(:filter_metadata) { { :type => 'special' }}
223
+ include_examples "matching filters"
224
+ end
225
+
226
+ context "against a symbol" do
227
+ let(:filter_metadata) { { :type => :special }}
228
+ include_examples "matching filters"
229
+ end
230
+ end
231
+
232
+ context "matching a symbol" do
233
+ let(:spec_metadata) { { :type => :special }}
234
+
235
+ context "against a string" do
236
+ let(:filter_metadata) { { :type => 'special' }}
237
+ include_examples "matching filters"
238
+ end
239
+
240
+ context "against a symbol" do
241
+ let(:filter_metadata) { { :type => :special }}
242
+ include_examples "matching filters"
243
+ end
244
+ end
245
+
246
+ context "with no filters" do
247
+ it "returns all" do
248
+ group = ExampleGroup.describe
249
+ group.stub(:world) { world }
250
+ example = group.example("does something")
251
+ group.filtered_examples.should eq([example])
252
+ end
253
+ end
254
+
255
+ context "with no examples or groups that match filters" do
256
+ it "returns none" do
257
+ filter_manager = FilterManager.new
258
+ filter_manager.include :awesome => false
259
+ world.stub(:filter_manager => filter_manager)
260
+ group = ExampleGroup.describe
261
+ group.stub(:world) { world }
262
+ group.example("does something")
263
+ group.filtered_examples.should eq([])
264
+ end
265
+ end
266
+ end
267
+
268
+ describe '#described_class' do
269
+
270
+ context "with a constant as the first parameter" do
271
+ it "is that constant" do
272
+ ExampleGroup.describe(Object) { }.described_class.should eq(Object)
273
+ end
274
+ end
275
+
276
+ context "with a string as the first parameter" do
277
+ it "is nil" do
278
+ ExampleGroup.describe("i'm a computer") { }.described_class.should be_nil
279
+ end
280
+ end
281
+
282
+ context "with a constant in an outer group" do
283
+ context "and a string in an inner group" do
284
+ it "is the top level constant" do
285
+ group = ExampleGroup.describe(String) do
286
+ describe :symbol do
287
+ example "described_class is String" do
288
+ described_class.should eq(String)
289
+ end
290
+ end
291
+ end
292
+
293
+ group.run.should be_true
294
+ end
295
+ end
296
+
297
+ context "and metadata redefinition after `described_class` call" do
298
+ it "is the redefined level constant" do
299
+ group = ExampleGroup.describe(String) do
300
+ described_class
301
+ metadata[:example_group][:described_class] = Object
302
+ describe :symbol do
303
+ example "described_class is Object" do
304
+ described_class.should eq(Object)
305
+ end
306
+ end
307
+ end
308
+
309
+ group.run.should be_true
310
+ end
311
+ end
312
+ end
313
+
314
+ context "in a nested group" do
315
+ it "inherits the described class/module from the outer group" do
316
+ group = ExampleGroup.describe(String) do
317
+ describe Array do
318
+ example "desribes is String" do
319
+ described_class.should eq(String)
320
+ end
321
+ end
322
+ end
323
+
324
+ group.run.should be_true, "expected examples in group to pass"
325
+ end
326
+ end
327
+ end
328
+
329
+ describe '#described_class' do
330
+ it "is the same as described_class" do
331
+ self.class.described_class.should eq(self.class.described_class)
332
+ end
333
+ end
334
+
335
+ describe '#description' do
336
+ it "grabs the description from the metadata" do
337
+ group = ExampleGroup.describe(Object, "my desc") { }
338
+ group.description.should eq(group.metadata[:example_group][:description])
339
+ end
340
+ end
341
+
342
+ describe '#metadata' do
343
+ it "adds the third parameter to the metadata" do
344
+ ExampleGroup.describe(Object, nil, 'foo' => 'bar') { }.metadata.should include({ "foo" => 'bar' })
345
+ end
346
+
347
+ it "adds the the file_path to metadata" do
348
+ ExampleGroup.describe(Object) { }.metadata[:example_group][:file_path].should eq(relative_path(__FILE__))
349
+ end
350
+
351
+ it "has a reader for file_path" do
352
+ ExampleGroup.describe(Object) { }.file_path.should eq(relative_path(__FILE__))
353
+ end
354
+
355
+ it "adds the line_number to metadata" do
356
+ ExampleGroup.describe(Object) { }.metadata[:example_group][:line_number].should eq(__LINE__)
357
+ end
358
+ end
359
+
360
+ [:focus, :focused].each do |example_alias|
361
+ describe "##{example_alias}" do
362
+ let(:focused_example) { ExampleGroup.describe.send example_alias, "a focused example" }
363
+
364
+ it 'defines an example that can be filtered with :focused => true' do
365
+ focused_example.metadata[:focused].should be_true
366
+ end
367
+
368
+ it 'defines an example that can be filtered with :focus => true' do
369
+ focused_example.metadata[:focus].should be_true
370
+ end
371
+ end
372
+ end
373
+
374
+ describe "#before, after, and around hooks" do
375
+ it "runs the before alls in order" do
376
+ group = ExampleGroup.describe
377
+ order = []
378
+ group.before(:all) { order << 1 }
379
+ group.before(:all) { order << 2 }
380
+ group.before(:all) { order << 3 }
381
+ group.example("example") {}
382
+
383
+ group.run
384
+
385
+ order.should eq([1,2,3])
386
+ end
387
+
388
+ it "runs the before eachs in order" do
389
+ group = ExampleGroup.describe
390
+ order = []
391
+ group.before(:each) { order << 1 }
392
+ group.before(:each) { order << 2 }
393
+ group.before(:each) { order << 3 }
394
+ group.example("example") {}
395
+
396
+ group.run
397
+
398
+ order.should eq([1,2,3])
399
+ end
400
+
401
+ it "runs the after eachs in reverse order" do
402
+ group = ExampleGroup.describe
403
+ order = []
404
+ group.after(:each) { order << 1 }
405
+ group.after(:each) { order << 2 }
406
+ group.after(:each) { order << 3 }
407
+ group.example("example") {}
408
+
409
+ group.run
410
+
411
+ order.should eq([3,2,1])
412
+ end
413
+
414
+ it "runs the after alls in reverse order" do
415
+ group = ExampleGroup.describe
416
+ order = []
417
+ group.after(:all) { order << 1 }
418
+ group.after(:all) { order << 2 }
419
+ group.after(:all) { order << 3 }
420
+ group.example("example") {}
421
+
422
+ group.run
423
+
424
+ order.should eq([3,2,1])
425
+ end
426
+
427
+ it "only runs before/after(:all) hooks from example groups that have specs that run" do
428
+ hooks_run = []
429
+
430
+ RSpec.configure do |c|
431
+ c.filter_run :focus => true
432
+ end
433
+
434
+ unfiltered_group = ExampleGroup.describe "unfiltered" do
435
+ before(:all) { hooks_run << :unfiltered_before_all }
436
+ after(:all) { hooks_run << :unfiltered_after_all }
437
+
438
+ context "a subcontext" do
439
+ it("has an example") { }
440
+ end
441
+ end
442
+
443
+ filtered_group = ExampleGroup.describe "filtered", :focus => true do
444
+ before(:all) { hooks_run << :filtered_before_all }
445
+ after(:all) { hooks_run << :filtered_after_all }
446
+
447
+ context "a subcontext" do
448
+ it("has an example") { }
449
+ end
450
+ end
451
+
452
+ unfiltered_group.run
453
+ filtered_group.run
454
+
455
+ hooks_run.should eq([:filtered_before_all, :filtered_after_all])
456
+ end
457
+
458
+ it "runs before_all_defined_in_config, before all, before each, example, after each, after all, after_all_defined_in_config in that order" do
459
+ order = []
460
+
461
+ RSpec.configure do |c|
462
+ c.before(:all) { order << :before_all_defined_in_config }
463
+ c.after(:all) { order << :after_all_defined_in_config }
464
+ end
465
+
466
+ group = ExampleGroup.describe
467
+ group.before(:all) { order << :top_level_before_all }
468
+ group.before(:each) { order << :before_each }
469
+ group.after(:each) { order << :after_each }
470
+ group.after(:all) { order << :top_level_after_all }
471
+ group.example("top level example") { order << :top_level_example }
472
+
473
+ context1 = group.describe("context 1")
474
+ context1.before(:all) { order << :nested_before_all }
475
+ context1.example("nested example 1") { order << :nested_example_1 }
476
+
477
+ context2 = group.describe("context 2")
478
+ context2.after(:all) { order << :nested_after_all }
479
+ context2.example("nested example 2") { order << :nested_example_2 }
480
+
481
+ group.run
482
+
483
+ order.should eq([
484
+ :before_all_defined_in_config,
485
+ :top_level_before_all,
486
+ :before_each,
487
+ :top_level_example,
488
+ :after_each,
489
+ :nested_before_all,
490
+ :before_each,
491
+ :nested_example_1,
492
+ :after_each,
493
+ :before_each,
494
+ :nested_example_2,
495
+ :after_each,
496
+ :nested_after_all,
497
+ :top_level_after_all,
498
+ :after_all_defined_in_config
499
+ ])
500
+ end
501
+
502
+ context "after(:all)" do
503
+ let(:outer) { ExampleGroup.describe }
504
+ let(:inner) { outer.describe }
505
+
506
+ it "has access to state defined before(:all)" do
507
+ outer.before(:all) { @outer = "outer" }
508
+ inner.before(:all) { @inner = "inner" }
509
+
510
+ outer.after(:all) do
511
+ @outer.should eq("outer")
512
+ @inner.should eq("inner")
513
+ end
514
+ inner.after(:all) do
515
+ @inner.should eq("inner")
516
+ @outer.should eq("outer")
517
+ end
518
+
519
+ outer.run
520
+ end
521
+
522
+ it "cleans up ivars in after(:all)" do
523
+ outer.before(:all) { @outer = "outer" }
524
+ inner.before(:all) { @inner = "inner" }
525
+
526
+ outer.run
527
+
528
+ inner.before_all_ivars[:@inner].should be_nil
529
+ inner.before_all_ivars[:@outer].should be_nil
530
+ outer.before_all_ivars[:@inner].should be_nil
531
+ outer.before_all_ivars[:@outer].should be_nil
532
+ end
533
+ end
534
+
535
+ it "treats an error in before(:each) as a failure" do
536
+ group = ExampleGroup.describe
537
+ group.before(:each) { raise "error in before each" }
538
+ example = group.example("equality") { 1.should eq(2) }
539
+ group.run.should be(false)
540
+
541
+ example.metadata[:execution_result][:exception].message.should eq("error in before each")
542
+ end
543
+
544
+ it "treats an error in before(:all) as a failure" do
545
+ group = ExampleGroup.describe
546
+ group.before(:all) { raise "error in before all" }
547
+ example = group.example("equality") { 1.should eq(2) }
548
+ group.run.should be_false
549
+
550
+ example.metadata.should_not be_nil
551
+ example.metadata[:execution_result].should_not be_nil
552
+ example.metadata[:execution_result][:exception].should_not be_nil
553
+ example.metadata[:execution_result][:exception].message.should eq("error in before all")
554
+ end
555
+
556
+ it "treats an error in before(:all) as a failure for a spec in a nested group" do
557
+ example = nil
558
+ group = ExampleGroup.describe do
559
+ before(:all) { raise "error in before all" }
560
+
561
+ describe "nested" do
562
+ example = it("equality") { 1.should eq(2) }
563
+ end
564
+ end
565
+ group.run
566
+
567
+ example.metadata.should_not be_nil
568
+ example.metadata[:execution_result].should_not be_nil
569
+ example.metadata[:execution_result][:exception].should_not be_nil
570
+ example.metadata[:execution_result][:exception].message.should eq("error in before all")
571
+ end
572
+
573
+ context "when an error occurs in an after(:all) hook" do
574
+ before(:each) do
575
+ RSpec.configuration.reporter.stub(:message)
576
+ end
577
+
578
+ let(:group) do
579
+ ExampleGroup.describe do
580
+ after(:all) { raise "error in after all" }
581
+ it("equality") { 1.should eq(1) }
582
+ end
583
+ end
584
+
585
+ it "allows the example to pass" do
586
+ group.run
587
+ example = group.examples.first
588
+ example.metadata.should_not be_nil
589
+ example.metadata[:execution_result].should_not be_nil
590
+ example.metadata[:execution_result][:status].should eq("passed")
591
+ end
592
+
593
+ it "rescues the error and prints it out" do
594
+ RSpec.configuration.reporter.should_receive(:message).with(/error in after all/)
595
+ group.run
596
+ end
597
+ end
598
+
599
+ it "has no 'running example' within before(:all)" do
600
+ group = ExampleGroup.describe
601
+ running_example = :none
602
+ group.before(:all) { running_example = example }
603
+ group.example("no-op") { }
604
+ group.run
605
+ running_example.should be(nil)
606
+ end
607
+
608
+ it "has access to example options within before(:each)" do
609
+ group = ExampleGroup.describe
610
+ option = nil
611
+ group.before(:each) { option = example.options[:data] }
612
+ group.example("no-op", :data => :sample) { }
613
+ group.run
614
+ option.should eq(:sample)
615
+ end
616
+
617
+ it "has access to example options within after(:each)" do
618
+ group = ExampleGroup.describe
619
+ option = nil
620
+ group.after(:each) { option = example.options[:data] }
621
+ group.example("no-op", :data => :sample) { }
622
+ group.run
623
+ option.should eq(:sample)
624
+ end
625
+
626
+ it "has no 'running example' within after(:all)" do
627
+ group = ExampleGroup.describe
628
+ running_example = :none
629
+ group.after(:all) { running_example = example }
630
+ group.example("no-op") { }
631
+ group.run
632
+ running_example.should be(nil)
633
+ end
634
+ end
635
+
636
+ %w[pending xit xspecify xexample].each do |method_name|
637
+ describe "::#{method_name}" do
638
+ before do
639
+ @group = ExampleGroup.describe
640
+ @group.send(method_name, "is pending") { }
641
+ end
642
+
643
+ it "generates a pending example" do
644
+ @group.run
645
+ @group.examples.first.should be_pending
646
+ end
647
+
648
+ it "sets the pending message", :if => method_name == 'pending' do
649
+ @group.run
650
+ @group.examples.first.metadata[:execution_result][:pending_message].should eq(RSpec::Core::Pending::NO_REASON_GIVEN)
651
+ end
652
+
653
+ it "sets the pending message", :unless => method_name == 'pending' do
654
+ @group.run
655
+ @group.examples.first.metadata[:execution_result][:pending_message].should eq("Temporarily disabled with #{method_name}")
656
+ end
657
+ end
658
+ end
659
+
660
+ describe "adding examples" do
661
+
662
+ it "allows adding an example using 'it'" do
663
+ group = ExampleGroup.describe
664
+ group.it("should do something") { }
665
+ group.examples.size.should eq(1)
666
+ end
667
+
668
+ it "exposes all examples at examples" do
669
+ group = ExampleGroup.describe
670
+ group.it("should do something 1") { }
671
+ group.it("should do something 2") { }
672
+ group.it("should do something 3") { }
673
+ group.should have(3).examples
674
+ end
675
+
676
+ it "maintains the example order" do
677
+ group = ExampleGroup.describe
678
+ group.it("should 1") { }
679
+ group.it("should 2") { }
680
+ group.it("should 3") { }
681
+ group.examples[0].description.should eq('should 1')
682
+ group.examples[1].description.should eq('should 2')
683
+ group.examples[2].description.should eq('should 3')
684
+ end
685
+
686
+ end
687
+
688
+ describe Object, "describing nested example_groups", :little_less_nested => 'yep' do
689
+
690
+ describe "A sample nested group", :nested_describe => "yep" do
691
+ it "sets the described class to the described class of the outer most group" do
692
+ example.example_group.described_class.should eq(ExampleGroup)
693
+ end
694
+
695
+ it "sets the description to 'A sample nested describe'" do
696
+ example.example_group.description.should eq('A sample nested group')
697
+ end
698
+
699
+ it "has top level metadata from the example_group and its ancestors" do
700
+ example.example_group.metadata.should include(:little_less_nested => 'yep', :nested_describe => 'yep')
701
+ end
702
+
703
+ it "exposes the parent metadata to the contained examples" do
704
+ example.metadata.should include(:little_less_nested => 'yep', :nested_describe => 'yep')
705
+ end
706
+ end
707
+
708
+ end
709
+
710
+ describe "#run_examples" do
711
+
712
+ let(:reporter) { double("reporter").as_null_object }
713
+
714
+ it "returns true if all examples pass" do
715
+ group = ExampleGroup.describe('group') do
716
+ example('ex 1') { 1.should eq(1) }
717
+ example('ex 2') { 1.should eq(1) }
718
+ end
719
+ group.stub(:filtered_examples) { group.examples.extend(Extensions::Ordered) }
720
+ group.run(reporter).should be_true
721
+ end
722
+
723
+ it "returns false if any of the examples fail" do
724
+ group = ExampleGroup.describe('group') do
725
+ example('ex 1') { 1.should eq(1) }
726
+ example('ex 2') { 1.should eq(2) }
727
+ end
728
+ group.stub(:filtered_examples) { group.examples.extend(Extensions::Ordered) }
729
+ group.run(reporter).should be_false
730
+ end
731
+
732
+ it "runs all examples, regardless of any of them failing" do
733
+ group = ExampleGroup.describe('group') do
734
+ example('ex 1') { 1.should eq(2) }
735
+ example('ex 2') { 1.should eq(1) }
736
+ end
737
+ group.stub(:filtered_examples) { group.examples.extend(Extensions::Ordered) }
738
+ group.filtered_examples.each do |example|
739
+ example.should_receive(:run)
740
+ end
741
+ group.run(reporter).should be_false
742
+ end
743
+ end
744
+
745
+ describe "how instance variables are inherited" do
746
+ before(:all) do
747
+ @before_all_top_level = 'before_all_top_level'
748
+ end
749
+
750
+ before(:each) do
751
+ @before_each_top_level = 'before_each_top_level'
752
+ end
753
+
754
+ it "can access a before each ivar at the same level" do
755
+ @before_each_top_level.should eq('before_each_top_level')
756
+ end
757
+
758
+ it "can access a before all ivar at the same level" do
759
+ @before_all_top_level.should eq('before_all_top_level')
760
+ end
761
+
762
+ it "can access the before all ivars in the before_all_ivars hash", :ruby => 1.8 do
763
+ example.example_group.before_all_ivars.should include('@before_all_top_level' => 'before_all_top_level')
764
+ end
765
+
766
+ it "can access the before all ivars in the before_all_ivars hash", :ruby => 1.9 do
767
+ example.example_group.before_all_ivars.should include(:@before_all_top_level => 'before_all_top_level')
768
+ end
769
+
770
+ describe "but now I am nested" do
771
+ it "can access a parent example groups before each ivar at a nested level" do
772
+ @before_each_top_level.should eq('before_each_top_level')
773
+ end
774
+
775
+ it "can access a parent example groups before all ivar at a nested level" do
776
+ @before_all_top_level.should eq("before_all_top_level")
777
+ end
778
+
779
+ it "changes to before all ivars from within an example do not persist outside the current describe" do
780
+ @before_all_top_level = "ive been changed"
781
+ end
782
+
783
+ describe "accessing a before_all ivar that was changed in a parent example_group" do
784
+ it "does not have access to the modified version" do
785
+ @before_all_top_level.should eq('before_all_top_level')
786
+ end
787
+ end
788
+ end
789
+
790
+ end
791
+
792
+ describe "ivars are not shared across examples" do
793
+ it "(first example)" do
794
+ @a = 1
795
+ defined?(@b).should be_false
796
+ end
797
+
798
+ it "(second example)" do
799
+ @b = 2
800
+ defined?(@a).should be_false
801
+ end
802
+ end
803
+
804
+
805
+ describe "#top_level_description" do
806
+ it "returns the description from the outermost example group" do
807
+ group = nil
808
+ ExampleGroup.describe("top") do
809
+ context "middle" do
810
+ group = describe "bottom" do
811
+ end
812
+ end
813
+ end
814
+
815
+ group.top_level_description.should eq("top")
816
+ end
817
+ end
818
+
819
+ describe "#run" do
820
+ let(:reporter) { double("reporter").as_null_object }
821
+
822
+ context "with fail_fast? => true" do
823
+ it "does not run examples after the failed example" do
824
+ group = RSpec::Core::ExampleGroup.describe
825
+ group.stub(:fail_fast?) { true }
826
+ examples_run = []
827
+ group.example('example 1') { examples_run << self }
828
+ group.example('example 2') { examples_run << self; fail; }
829
+ group.example('example 3') { examples_run << self }
830
+
831
+ group.run
832
+
833
+ examples_run.length.should eq(2)
834
+ end
835
+ end
836
+
837
+ context "with RSpec.wants_to_quit=true" do
838
+ let(:group) { RSpec::Core::ExampleGroup.describe }
839
+
840
+ before do
841
+ RSpec.stub(:wants_to_quit) { true }
842
+ RSpec.stub(:clear_remaining_example_groups)
843
+ end
844
+
845
+ it "returns without starting the group" do
846
+ reporter.should_not_receive(:example_group_started)
847
+ group.run(reporter)
848
+ end
849
+
850
+ context "at top level" do
851
+ it "purges remaining groups" do
852
+ RSpec.should_receive(:clear_remaining_example_groups)
853
+ group.run(reporter)
854
+ end
855
+ end
856
+
857
+ context "in a nested group" do
858
+ it "does not purge remaining groups" do
859
+ nested_group = group.describe
860
+ RSpec.should_not_receive(:clear_remaining_example_groups)
861
+ nested_group.run(reporter)
862
+ end
863
+ end
864
+ end
865
+
866
+ context "with all examples passing" do
867
+ it "returns true" do
868
+ group = RSpec::Core::ExampleGroup.describe("something") do
869
+ it "does something" do
870
+ # pass
871
+ end
872
+ describe "nested" do
873
+ it "does something else" do
874
+ # pass
875
+ end
876
+ end
877
+ end
878
+
879
+ group.run(reporter).should be_true
880
+ end
881
+ end
882
+
883
+ context "with top level example failing" do
884
+ it "returns false" do
885
+ group = RSpec::Core::ExampleGroup.describe("something") do
886
+ it "does something (wrong - fail)" do
887
+ raise "fail"
888
+ end
889
+ describe "nested" do
890
+ it "does something else" do
891
+ # pass
892
+ end
893
+ end
894
+ end
895
+
896
+ group.run(reporter).should be_false
897
+ end
898
+ end
899
+
900
+ context "with nested example failing" do
901
+ it "returns true" do
902
+ group = RSpec::Core::ExampleGroup.describe("something") do
903
+ it "does something" do
904
+ # pass
905
+ end
906
+ describe "nested" do
907
+ it "does something else (wrong -fail)" do
908
+ raise "fail"
909
+ end
910
+ end
911
+ end
912
+
913
+ group.run(reporter).should be_false
914
+ end
915
+ end
916
+ end
917
+
918
+ %w[include_examples include_context].each do |name|
919
+ describe "##{name}" do
920
+ before do
921
+ shared_examples "named this" do
922
+ example("does something") {}
923
+ end
924
+ end
925
+
926
+ it "includes the named examples" do
927
+ group = ExampleGroup.describe
928
+ group.send(name, "named this")
929
+ group.examples.first.description.should eq("does something")
930
+ end
931
+
932
+ it "raises a helpful error message when shared content is not found" do
933
+ group = ExampleGroup.describe
934
+ expect do
935
+ group.send(name, "shared stuff")
936
+ end.to raise_error(ArgumentError, /Could not find .* "shared stuff"/)
937
+ end
938
+
939
+ it "passes parameters to the shared content" do
940
+ passed_params = {}
941
+
942
+ shared_examples "named this with params" do |param1, param2|
943
+ it("has access to the given parameters") do
944
+ passed_params[:param1] = param1
945
+ passed_params[:param2] = param2
946
+ end
947
+ end
948
+
949
+ group = ExampleGroup.describe
950
+ group.send(name, "named this with params", :value1, :value2)
951
+ group.run
952
+
953
+ passed_params.should eq({ :param1 => :value1, :param2 => :value2 })
954
+ end
955
+
956
+ it "adds shared instance methods to the group" do
957
+ shared_examples "named this with params" do |param1|
958
+ def foo; end
959
+ end
960
+ group = ExampleGroup.describe('fake group')
961
+ group.send(name, "named this with params", :a)
962
+ group.public_instance_methods.map{|m| m.to_s}.should include("foo")
963
+ end
964
+
965
+ it "evals the shared example group only once" do
966
+ eval_count = 0
967
+ shared_examples("named this with params") { |p| eval_count += 1 }
968
+ group = ExampleGroup.describe('fake group')
969
+ group.send(name, "named this with params", :a)
970
+ eval_count.should eq(1)
971
+ end
972
+
973
+ it "evals the block when given" do
974
+ key = "#{__FILE__}:#{__LINE__}"
975
+ shared_examples(key) do
976
+ it("does something") do
977
+ foo.should eq("bar")
978
+ end
979
+ end
980
+ group = ExampleGroup.describe do
981
+ send name, key do
982
+ def foo; "bar"; end
983
+ end
984
+ end
985
+ group.run.should be_true
986
+ end
987
+ end
988
+ end
989
+
990
+ describe "#it_should_behave_like" do
991
+ it "creates a nested group" do
992
+ shared_examples_for("thing") {}
993
+ group = ExampleGroup.describe('fake group')
994
+ group.it_should_behave_like("thing")
995
+ group.should have(1).children
996
+ end
997
+
998
+ it "creates a nested group for a class" do
999
+ klass = Class.new
1000
+ shared_examples_for(klass) {}
1001
+ group = ExampleGroup.describe('fake group')
1002
+ group.it_should_behave_like(klass)
1003
+ group.should have(1).children
1004
+ end
1005
+
1006
+ it "adds shared examples to nested group" do
1007
+ shared_examples_for("thing") do
1008
+ it("does something")
1009
+ end
1010
+ group = ExampleGroup.describe('fake group')
1011
+ shared_group = group.it_should_behave_like("thing")
1012
+ shared_group.should have(1).examples
1013
+ end
1014
+
1015
+ it "adds shared instance methods to nested group" do
1016
+ shared_examples_for("thing") do
1017
+ def foo; end
1018
+ end
1019
+ group = ExampleGroup.describe('fake group')
1020
+ shared_group = group.it_should_behave_like("thing")
1021
+ shared_group.public_instance_methods.map{|m| m.to_s}.should include("foo")
1022
+ end
1023
+
1024
+ it "adds shared class methods to nested group" do
1025
+ shared_examples_for("thing") do
1026
+ def self.foo; end
1027
+ end
1028
+ group = ExampleGroup.describe('fake group')
1029
+ shared_group = group.it_should_behave_like("thing")
1030
+ shared_group.methods.map{|m| m.to_s}.should include("foo")
1031
+ end
1032
+
1033
+ it "passes parameters to the shared example group" do
1034
+ passed_params = {}
1035
+
1036
+ shared_examples_for("thing") do |param1, param2|
1037
+ it("has access to the given parameters") do
1038
+ passed_params[:param1] = param1
1039
+ passed_params[:param2] = param2
1040
+ end
1041
+ end
1042
+
1043
+ group = ExampleGroup.describe("group") do
1044
+ it_should_behave_like "thing", :value1, :value2
1045
+ end
1046
+ group.run
1047
+
1048
+ passed_params.should eq({ :param1 => :value1, :param2 => :value2 })
1049
+ end
1050
+
1051
+ it "adds shared instance methods to nested group" do
1052
+ shared_examples_for("thing") do |param1|
1053
+ def foo; end
1054
+ end
1055
+ group = ExampleGroup.describe('fake group')
1056
+ shared_group = group.it_should_behave_like("thing", :a)
1057
+ shared_group.public_instance_methods.map{|m| m.to_s}.should include("foo")
1058
+ end
1059
+
1060
+ it "evals the shared example group only once" do
1061
+ eval_count = 0
1062
+ shared_examples_for("thing") { |p| eval_count += 1 }
1063
+ group = ExampleGroup.describe('fake group')
1064
+ group.it_should_behave_like("thing", :a)
1065
+ eval_count.should eq(1)
1066
+ end
1067
+
1068
+ context "given a block" do
1069
+ it "evaluates the block in nested group" do
1070
+ scopes = []
1071
+ shared_examples_for("thing") do
1072
+ it("gets run in the nested group") do
1073
+ scopes << self.class
1074
+ end
1075
+ end
1076
+ group = ExampleGroup.describe("group") do
1077
+ it_should_behave_like "thing" do
1078
+ it("gets run in the same nested group") do
1079
+ scopes << self.class
1080
+ end
1081
+ end
1082
+ end
1083
+ group.run
1084
+
1085
+ scopes[0].should be(scopes[1])
1086
+ end
1087
+ end
1088
+
1089
+ it "raises a helpful error message when shared context is not found" do
1090
+ expect do
1091
+ ExampleGroup.describe do
1092
+ it_should_behave_like "shared stuff"
1093
+ end
1094
+ end.to raise_error(ArgumentError,%q|Could not find shared examples "shared stuff"|)
1095
+ end
1096
+ end
1097
+ end
1098
+ end