rspec-core 2.11.1 → 3.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.document +1 -1
  4. data/.yardopts +3 -1
  5. data/Changelog.md +1814 -29
  6. data/{License.txt → LICENSE.md} +6 -4
  7. data/README.md +197 -48
  8. data/exe/rspec +2 -23
  9. data/lib/rspec/autorun.rb +1 -0
  10. data/lib/rspec/core/backtrace_formatter.rb +65 -0
  11. data/lib/rspec/core/bisect/coordinator.rb +62 -0
  12. data/lib/rspec/core/bisect/example_minimizer.rb +173 -0
  13. data/lib/rspec/core/bisect/fork_runner.rb +138 -0
  14. data/lib/rspec/core/bisect/server.rb +61 -0
  15. data/lib/rspec/core/bisect/shell_command.rb +126 -0
  16. data/lib/rspec/core/bisect/shell_runner.rb +73 -0
  17. data/lib/rspec/core/bisect/utilities.rb +69 -0
  18. data/lib/rspec/core/configuration.rb +1846 -407
  19. data/lib/rspec/core/configuration_options.rb +154 -50
  20. data/lib/rspec/core/did_you_mean.rb +46 -0
  21. data/lib/rspec/core/drb.rb +120 -0
  22. data/lib/rspec/core/dsl.rb +90 -18
  23. data/lib/rspec/core/example.rb +488 -152
  24. data/lib/rspec/core/example_group.rb +733 -294
  25. data/lib/rspec/core/example_status_persister.rb +235 -0
  26. data/lib/rspec/core/filter_manager.rb +175 -147
  27. data/lib/rspec/core/flat_map.rb +20 -0
  28. data/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
  29. data/lib/rspec/core/formatters/base_formatter.rb +32 -130
  30. data/lib/rspec/core/formatters/base_text_formatter.rb +62 -190
  31. data/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
  32. data/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
  33. data/lib/rspec/core/formatters/console_codes.rb +76 -0
  34. data/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
  35. data/lib/rspec/core/formatters/documentation_formatter.rb +62 -27
  36. data/lib/rspec/core/formatters/exception_presenter.rb +521 -0
  37. data/lib/rspec/core/formatters/failure_list_formatter.rb +23 -0
  38. data/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
  39. data/lib/rspec/core/formatters/helpers.rb +93 -14
  40. data/lib/rspec/core/formatters/html_formatter.rb +104 -415
  41. data/lib/rspec/core/formatters/html_printer.rb +414 -0
  42. data/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
  43. data/lib/rspec/core/formatters/json_formatter.rb +102 -0
  44. data/lib/rspec/core/formatters/profile_formatter.rb +68 -0
  45. data/lib/rspec/core/formatters/progress_formatter.rb +12 -15
  46. data/lib/rspec/core/formatters/protocol.rb +182 -0
  47. data/lib/rspec/core/formatters/snippet_extractor.rb +115 -39
  48. data/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
  49. data/lib/rspec/core/formatters.rb +279 -0
  50. data/lib/rspec/core/hooks.rb +451 -300
  51. data/lib/rspec/core/invocations.rb +87 -0
  52. data/lib/rspec/core/memoized_helpers.rb +580 -0
  53. data/lib/rspec/core/metadata.rb +395 -173
  54. data/lib/rspec/core/metadata_filter.rb +255 -0
  55. data/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
  56. data/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
  57. data/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
  58. data/lib/rspec/core/mocking_adapters/null.rb +14 -0
  59. data/lib/rspec/core/mocking_adapters/rr.rb +31 -0
  60. data/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
  61. data/lib/rspec/core/notifications.rb +521 -0
  62. data/lib/rspec/core/option_parser.rb +208 -64
  63. data/lib/rspec/core/ordering.rb +169 -0
  64. data/lib/rspec/core/output_wrapper.rb +29 -0
  65. data/lib/rspec/core/pending.rb +115 -59
  66. data/lib/rspec/core/profiler.rb +34 -0
  67. data/lib/rspec/core/project_initializer/.rspec +1 -0
  68. data/lib/rspec/core/project_initializer/spec/spec_helper.rb +98 -0
  69. data/lib/rspec/core/project_initializer.rb +26 -65
  70. data/lib/rspec/core/rake_task.rb +140 -131
  71. data/lib/rspec/core/reporter.rb +207 -44
  72. data/lib/rspec/core/ruby_project.rb +15 -6
  73. data/lib/rspec/core/runner.rb +180 -44
  74. data/lib/rspec/core/sandbox.rb +37 -0
  75. data/lib/rspec/core/set.rb +54 -0
  76. data/lib/rspec/core/shared_context.rb +25 -19
  77. data/lib/rspec/core/shared_example_group.rb +229 -54
  78. data/lib/rspec/core/shell_escape.rb +49 -0
  79. data/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
  80. data/lib/rspec/core/version.rb +3 -1
  81. data/lib/rspec/core/warnings.rb +40 -0
  82. data/lib/rspec/core/world.rb +208 -49
  83. data/lib/rspec/core.rb +166 -80
  84. data.tar.gz.sig +0 -0
  85. metadata +230 -445
  86. metadata.gz.sig +0 -0
  87. data/exe/autospec +0 -13
  88. data/features/Autotest.md +0 -38
  89. data/features/README.md +0 -17
  90. data/features/Upgrade.md +0 -364
  91. data/features/command_line/README.md +0 -28
  92. data/features/command_line/example_name_option.feature +0 -101
  93. data/features/command_line/exit_status.feature +0 -83
  94. data/features/command_line/format_option.feature +0 -81
  95. data/features/command_line/init.feature +0 -18
  96. data/features/command_line/line_number_appended_to_path.feature +0 -140
  97. data/features/command_line/line_number_option.feature +0 -58
  98. data/features/command_line/order.feature +0 -29
  99. data/features/command_line/pattern_option.feature +0 -31
  100. data/features/command_line/rake_task.feature +0 -68
  101. data/features/command_line/ruby.feature +0 -22
  102. data/features/command_line/tag.feature +0 -91
  103. data/features/configuration/alias_example_to.feature +0 -48
  104. data/features/configuration/custom_settings.feature +0 -84
  105. data/features/configuration/default_path.feature +0 -38
  106. data/features/configuration/fail_fast.feature +0 -77
  107. data/features/configuration/read_options_from_file.feature +0 -87
  108. data/features/example_groups/basic_structure.feature +0 -55
  109. data/features/example_groups/shared_context.feature +0 -74
  110. data/features/example_groups/shared_examples.feature +0 -204
  111. data/features/expectation_framework_integration/configure_expectation_framework.feature +0 -102
  112. data/features/filtering/exclusion_filters.feature +0 -139
  113. data/features/filtering/if_and_unless.feature +0 -168
  114. data/features/filtering/inclusion_filters.feature +0 -105
  115. data/features/filtering/run_all_when_everything_filtered.feature +0 -46
  116. data/features/formatters/custom_formatter.feature +0 -36
  117. data/features/formatters/text_formatter.feature +0 -46
  118. data/features/helper_methods/arbitrary_methods.feature +0 -40
  119. data/features/helper_methods/let.feature +0 -50
  120. data/features/helper_methods/modules.feature +0 -149
  121. data/features/hooks/around_hooks.feature +0 -343
  122. data/features/hooks/before_and_after_hooks.feature +0 -423
  123. data/features/hooks/filtering.feature +0 -234
  124. data/features/metadata/current_example.feature +0 -17
  125. data/features/metadata/described_class.feature +0 -17
  126. data/features/metadata/user_defined.feature +0 -113
  127. data/features/mock_framework_integration/use_any_framework.feature +0 -106
  128. data/features/mock_framework_integration/use_flexmock.feature +0 -96
  129. data/features/mock_framework_integration/use_mocha.feature +0 -97
  130. data/features/mock_framework_integration/use_rr.feature +0 -98
  131. data/features/mock_framework_integration/use_rspec.feature +0 -97
  132. data/features/pending/pending_examples.feature +0 -229
  133. data/features/spec_files/arbitrary_file_suffix.feature +0 -13
  134. data/features/step_definitions/additional_cli_steps.rb +0 -30
  135. data/features/subject/attribute_of_subject.feature +0 -124
  136. data/features/subject/explicit_subject.feature +0 -82
  137. data/features/subject/implicit_receiver.feature +0 -29
  138. data/features/subject/implicit_subject.feature +0 -63
  139. data/features/support/env.rb +0 -12
  140. data/lib/autotest/discover.rb +0 -1
  141. data/lib/autotest/rspec2.rb +0 -73
  142. data/lib/rspec/core/backward_compatibility.rb +0 -65
  143. data/lib/rspec/core/command_line.rb +0 -36
  144. data/lib/rspec/core/deprecation.rb +0 -36
  145. data/lib/rspec/core/drb_command_line.rb +0 -26
  146. data/lib/rspec/core/drb_options.rb +0 -87
  147. data/lib/rspec/core/extensions/instance_eval_with_args.rb +0 -44
  148. data/lib/rspec/core/extensions/kernel.rb +0 -9
  149. data/lib/rspec/core/extensions/module_eval_with_args.rb +0 -38
  150. data/lib/rspec/core/extensions/ordered.rb +0 -21
  151. data/lib/rspec/core/extensions.rb +0 -4
  152. data/lib/rspec/core/formatters/text_mate_formatter.rb +0 -34
  153. data/lib/rspec/core/let.rb +0 -110
  154. data/lib/rspec/core/load_path.rb +0 -3
  155. data/lib/rspec/core/metadata_hash_builder.rb +0 -97
  156. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +0 -11
  157. data/lib/rspec/core/mocking/with_flexmock.rb +0 -27
  158. data/lib/rspec/core/mocking/with_mocha.rb +0 -29
  159. data/lib/rspec/core/mocking/with_rr.rb +0 -27
  160. data/lib/rspec/core/mocking/with_rspec.rb +0 -23
  161. data/lib/rspec/core/subject.rb +0 -219
  162. data/spec/autotest/discover_spec.rb +0 -19
  163. data/spec/autotest/failed_results_re_spec.rb +0 -45
  164. data/spec/autotest/rspec_spec.rb +0 -123
  165. data/spec/command_line/order_spec.rb +0 -137
  166. data/spec/rspec/core/command_line_spec.rb +0 -108
  167. data/spec/rspec/core/command_line_spec_output.txt +0 -0
  168. data/spec/rspec/core/configuration_options_spec.rb +0 -377
  169. data/spec/rspec/core/configuration_spec.rb +0 -1196
  170. data/spec/rspec/core/deprecations_spec.rb +0 -66
  171. data/spec/rspec/core/drb_command_line_spec.rb +0 -108
  172. data/spec/rspec/core/drb_options_spec.rb +0 -180
  173. data/spec/rspec/core/dsl_spec.rb +0 -17
  174. data/spec/rspec/core/example_group_spec.rb +0 -1098
  175. data/spec/rspec/core/example_spec.rb +0 -370
  176. data/spec/rspec/core/filter_manager_spec.rb +0 -256
  177. data/spec/rspec/core/formatters/base_formatter_spec.rb +0 -80
  178. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +0 -363
  179. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +0 -88
  180. data/spec/rspec/core/formatters/helpers_spec.rb +0 -66
  181. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +0 -410
  182. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +0 -409
  183. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +0 -416
  184. data/spec/rspec/core/formatters/html_formatted-1.9.3.html +0 -416
  185. data/spec/rspec/core/formatters/html_formatter_spec.rb +0 -82
  186. data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -30
  187. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +0 -18
  188. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +0 -410
  189. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +0 -409
  190. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +0 -416
  191. data/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +0 -416
  192. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +0 -83
  193. data/spec/rspec/core/hooks_filtering_spec.rb +0 -227
  194. data/spec/rspec/core/hooks_spec.rb +0 -250
  195. data/spec/rspec/core/kernel_extensions_spec.rb +0 -9
  196. data/spec/rspec/core/let_spec.rb +0 -55
  197. data/spec/rspec/core/metadata_spec.rb +0 -447
  198. data/spec/rspec/core/option_parser_spec.rb +0 -166
  199. data/spec/rspec/core/pending_example_spec.rb +0 -220
  200. data/spec/rspec/core/project_initializer_spec.rb +0 -130
  201. data/spec/rspec/core/rake_task_spec.rb +0 -138
  202. data/spec/rspec/core/reporter_spec.rb +0 -103
  203. data/spec/rspec/core/resources/a_bar.rb +0 -0
  204. data/spec/rspec/core/resources/a_foo.rb +0 -0
  205. data/spec/rspec/core/resources/a_spec.rb +0 -1
  206. data/spec/rspec/core/resources/custom_example_group_runner.rb +0 -14
  207. data/spec/rspec/core/resources/formatter_specs.rb +0 -60
  208. data/spec/rspec/core/resources/utf8_encoded.rb +0 -8
  209. data/spec/rspec/core/rspec_matchers_spec.rb +0 -45
  210. data/spec/rspec/core/ruby_project_spec.rb +0 -24
  211. data/spec/rspec/core/runner_spec.rb +0 -81
  212. data/spec/rspec/core/shared_context_spec.rb +0 -67
  213. data/spec/rspec/core/shared_example_group_spec.rb +0 -84
  214. data/spec/rspec/core/subject_spec.rb +0 -244
  215. data/spec/rspec/core/world_spec.rb +0 -144
  216. data/spec/rspec/core_spec.rb +0 -35
  217. data/spec/spec_helper.rb +0 -98
  218. data/spec/support/config_options_helper.rb +0 -24
  219. data/spec/support/helper_methods.rb +0 -5
  220. data/spec/support/matchers.rb +0 -65
  221. data/spec/support/shared_example_groups.rb +0 -41
  222. data/spec/support/spec_files.rb +0 -44
@@ -1,66 +0,0 @@
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
@@ -1,108 +0,0 @@
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
@@ -1,180 +0,0 @@
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
@@ -1,17 +0,0 @@
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
-