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.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/.document +1 -1
- data/.yardopts +3 -1
- data/Changelog.md +1814 -29
- data/{License.txt → LICENSE.md} +6 -4
- data/README.md +197 -48
- data/exe/rspec +2 -23
- data/lib/rspec/autorun.rb +1 -0
- data/lib/rspec/core/backtrace_formatter.rb +65 -0
- data/lib/rspec/core/bisect/coordinator.rb +62 -0
- data/lib/rspec/core/bisect/example_minimizer.rb +173 -0
- data/lib/rspec/core/bisect/fork_runner.rb +138 -0
- data/lib/rspec/core/bisect/server.rb +61 -0
- data/lib/rspec/core/bisect/shell_command.rb +126 -0
- data/lib/rspec/core/bisect/shell_runner.rb +73 -0
- data/lib/rspec/core/bisect/utilities.rb +69 -0
- data/lib/rspec/core/configuration.rb +1846 -407
- data/lib/rspec/core/configuration_options.rb +154 -50
- data/lib/rspec/core/did_you_mean.rb +46 -0
- data/lib/rspec/core/drb.rb +120 -0
- data/lib/rspec/core/dsl.rb +90 -18
- data/lib/rspec/core/example.rb +488 -152
- data/lib/rspec/core/example_group.rb +733 -294
- data/lib/rspec/core/example_status_persister.rb +235 -0
- data/lib/rspec/core/filter_manager.rb +175 -147
- data/lib/rspec/core/flat_map.rb +20 -0
- data/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
- data/lib/rspec/core/formatters/base_formatter.rb +32 -130
- data/lib/rspec/core/formatters/base_text_formatter.rb +62 -190
- data/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
- data/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
- data/lib/rspec/core/formatters/console_codes.rb +76 -0
- data/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/lib/rspec/core/formatters/documentation_formatter.rb +62 -27
- data/lib/rspec/core/formatters/exception_presenter.rb +521 -0
- data/lib/rspec/core/formatters/failure_list_formatter.rb +23 -0
- data/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/lib/rspec/core/formatters/helpers.rb +93 -14
- data/lib/rspec/core/formatters/html_formatter.rb +104 -415
- data/lib/rspec/core/formatters/html_printer.rb +414 -0
- data/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
- data/lib/rspec/core/formatters/json_formatter.rb +102 -0
- data/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/lib/rspec/core/formatters/progress_formatter.rb +12 -15
- data/lib/rspec/core/formatters/protocol.rb +182 -0
- data/lib/rspec/core/formatters/snippet_extractor.rb +115 -39
- data/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
- data/lib/rspec/core/formatters.rb +279 -0
- data/lib/rspec/core/hooks.rb +451 -300
- data/lib/rspec/core/invocations.rb +87 -0
- data/lib/rspec/core/memoized_helpers.rb +580 -0
- data/lib/rspec/core/metadata.rb +395 -173
- data/lib/rspec/core/metadata_filter.rb +255 -0
- data/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/lib/rspec/core/notifications.rb +521 -0
- data/lib/rspec/core/option_parser.rb +208 -64
- data/lib/rspec/core/ordering.rb +169 -0
- data/lib/rspec/core/output_wrapper.rb +29 -0
- data/lib/rspec/core/pending.rb +115 -59
- data/lib/rspec/core/profiler.rb +34 -0
- data/lib/rspec/core/project_initializer/.rspec +1 -0
- data/lib/rspec/core/project_initializer/spec/spec_helper.rb +98 -0
- data/lib/rspec/core/project_initializer.rb +26 -65
- data/lib/rspec/core/rake_task.rb +140 -131
- data/lib/rspec/core/reporter.rb +207 -44
- data/lib/rspec/core/ruby_project.rb +15 -6
- data/lib/rspec/core/runner.rb +180 -44
- data/lib/rspec/core/sandbox.rb +37 -0
- data/lib/rspec/core/set.rb +54 -0
- data/lib/rspec/core/shared_context.rb +25 -19
- data/lib/rspec/core/shared_example_group.rb +229 -54
- data/lib/rspec/core/shell_escape.rb +49 -0
- data/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/lib/rspec/core/version.rb +3 -1
- data/lib/rspec/core/warnings.rb +40 -0
- data/lib/rspec/core/world.rb +208 -49
- data/lib/rspec/core.rb +166 -80
- data.tar.gz.sig +0 -0
- metadata +230 -445
- metadata.gz.sig +0 -0
- data/exe/autospec +0 -13
- data/features/Autotest.md +0 -38
- data/features/README.md +0 -17
- data/features/Upgrade.md +0 -364
- data/features/command_line/README.md +0 -28
- data/features/command_line/example_name_option.feature +0 -101
- data/features/command_line/exit_status.feature +0 -83
- data/features/command_line/format_option.feature +0 -81
- data/features/command_line/init.feature +0 -18
- data/features/command_line/line_number_appended_to_path.feature +0 -140
- data/features/command_line/line_number_option.feature +0 -58
- data/features/command_line/order.feature +0 -29
- data/features/command_line/pattern_option.feature +0 -31
- data/features/command_line/rake_task.feature +0 -68
- data/features/command_line/ruby.feature +0 -22
- data/features/command_line/tag.feature +0 -91
- data/features/configuration/alias_example_to.feature +0 -48
- data/features/configuration/custom_settings.feature +0 -84
- data/features/configuration/default_path.feature +0 -38
- data/features/configuration/fail_fast.feature +0 -77
- data/features/configuration/read_options_from_file.feature +0 -87
- data/features/example_groups/basic_structure.feature +0 -55
- data/features/example_groups/shared_context.feature +0 -74
- data/features/example_groups/shared_examples.feature +0 -204
- data/features/expectation_framework_integration/configure_expectation_framework.feature +0 -102
- data/features/filtering/exclusion_filters.feature +0 -139
- data/features/filtering/if_and_unless.feature +0 -168
- data/features/filtering/inclusion_filters.feature +0 -105
- data/features/filtering/run_all_when_everything_filtered.feature +0 -46
- data/features/formatters/custom_formatter.feature +0 -36
- data/features/formatters/text_formatter.feature +0 -46
- data/features/helper_methods/arbitrary_methods.feature +0 -40
- data/features/helper_methods/let.feature +0 -50
- data/features/helper_methods/modules.feature +0 -149
- data/features/hooks/around_hooks.feature +0 -343
- data/features/hooks/before_and_after_hooks.feature +0 -423
- data/features/hooks/filtering.feature +0 -234
- data/features/metadata/current_example.feature +0 -17
- data/features/metadata/described_class.feature +0 -17
- data/features/metadata/user_defined.feature +0 -113
- data/features/mock_framework_integration/use_any_framework.feature +0 -106
- data/features/mock_framework_integration/use_flexmock.feature +0 -96
- data/features/mock_framework_integration/use_mocha.feature +0 -97
- data/features/mock_framework_integration/use_rr.feature +0 -98
- data/features/mock_framework_integration/use_rspec.feature +0 -97
- data/features/pending/pending_examples.feature +0 -229
- data/features/spec_files/arbitrary_file_suffix.feature +0 -13
- data/features/step_definitions/additional_cli_steps.rb +0 -30
- data/features/subject/attribute_of_subject.feature +0 -124
- data/features/subject/explicit_subject.feature +0 -82
- data/features/subject/implicit_receiver.feature +0 -29
- data/features/subject/implicit_subject.feature +0 -63
- data/features/support/env.rb +0 -12
- data/lib/autotest/discover.rb +0 -1
- data/lib/autotest/rspec2.rb +0 -73
- data/lib/rspec/core/backward_compatibility.rb +0 -65
- data/lib/rspec/core/command_line.rb +0 -36
- data/lib/rspec/core/deprecation.rb +0 -36
- data/lib/rspec/core/drb_command_line.rb +0 -26
- data/lib/rspec/core/drb_options.rb +0 -87
- data/lib/rspec/core/extensions/instance_eval_with_args.rb +0 -44
- data/lib/rspec/core/extensions/kernel.rb +0 -9
- data/lib/rspec/core/extensions/module_eval_with_args.rb +0 -38
- data/lib/rspec/core/extensions/ordered.rb +0 -21
- data/lib/rspec/core/extensions.rb +0 -4
- data/lib/rspec/core/formatters/text_mate_formatter.rb +0 -34
- data/lib/rspec/core/let.rb +0 -110
- data/lib/rspec/core/load_path.rb +0 -3
- data/lib/rspec/core/metadata_hash_builder.rb +0 -97
- data/lib/rspec/core/mocking/with_absolutely_nothing.rb +0 -11
- data/lib/rspec/core/mocking/with_flexmock.rb +0 -27
- data/lib/rspec/core/mocking/with_mocha.rb +0 -29
- data/lib/rspec/core/mocking/with_rr.rb +0 -27
- data/lib/rspec/core/mocking/with_rspec.rb +0 -23
- data/lib/rspec/core/subject.rb +0 -219
- data/spec/autotest/discover_spec.rb +0 -19
- data/spec/autotest/failed_results_re_spec.rb +0 -45
- data/spec/autotest/rspec_spec.rb +0 -123
- data/spec/command_line/order_spec.rb +0 -137
- data/spec/rspec/core/command_line_spec.rb +0 -108
- data/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/spec/rspec/core/configuration_options_spec.rb +0 -377
- data/spec/rspec/core/configuration_spec.rb +0 -1196
- data/spec/rspec/core/deprecations_spec.rb +0 -66
- data/spec/rspec/core/drb_command_line_spec.rb +0 -108
- data/spec/rspec/core/drb_options_spec.rb +0 -180
- data/spec/rspec/core/dsl_spec.rb +0 -17
- data/spec/rspec/core/example_group_spec.rb +0 -1098
- data/spec/rspec/core/example_spec.rb +0 -370
- data/spec/rspec/core/filter_manager_spec.rb +0 -256
- data/spec/rspec/core/formatters/base_formatter_spec.rb +0 -80
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +0 -363
- data/spec/rspec/core/formatters/documentation_formatter_spec.rb +0 -88
- data/spec/rspec/core/formatters/helpers_spec.rb +0 -66
- data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +0 -410
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +0 -409
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +0 -416
- data/spec/rspec/core/formatters/html_formatted-1.9.3.html +0 -416
- data/spec/rspec/core/formatters/html_formatter_spec.rb +0 -82
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -30
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +0 -18
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +0 -410
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +0 -409
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +0 -416
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +0 -416
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +0 -83
- data/spec/rspec/core/hooks_filtering_spec.rb +0 -227
- data/spec/rspec/core/hooks_spec.rb +0 -250
- data/spec/rspec/core/kernel_extensions_spec.rb +0 -9
- data/spec/rspec/core/let_spec.rb +0 -55
- data/spec/rspec/core/metadata_spec.rb +0 -447
- data/spec/rspec/core/option_parser_spec.rb +0 -166
- data/spec/rspec/core/pending_example_spec.rb +0 -220
- data/spec/rspec/core/project_initializer_spec.rb +0 -130
- data/spec/rspec/core/rake_task_spec.rb +0 -138
- data/spec/rspec/core/reporter_spec.rb +0 -103
- data/spec/rspec/core/resources/a_bar.rb +0 -0
- data/spec/rspec/core/resources/a_foo.rb +0 -0
- data/spec/rspec/core/resources/a_spec.rb +0 -1
- data/spec/rspec/core/resources/custom_example_group_runner.rb +0 -14
- data/spec/rspec/core/resources/formatter_specs.rb +0 -60
- data/spec/rspec/core/resources/utf8_encoded.rb +0 -8
- data/spec/rspec/core/rspec_matchers_spec.rb +0 -45
- data/spec/rspec/core/ruby_project_spec.rb +0 -24
- data/spec/rspec/core/runner_spec.rb +0 -81
- data/spec/rspec/core/shared_context_spec.rb +0 -67
- data/spec/rspec/core/shared_example_group_spec.rb +0 -84
- data/spec/rspec/core/subject_spec.rb +0 -244
- data/spec/rspec/core/world_spec.rb +0 -144
- data/spec/rspec/core_spec.rb +0 -35
- data/spec/spec_helper.rb +0 -98
- data/spec/support/config_options_helper.rb +0 -24
- data/spec/support/helper_methods.rb +0 -5
- data/spec/support/matchers.rb +0 -65
- data/spec/support/shared_example_groups.rb +0 -41
- 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
|
data/spec/rspec/core/dsl_spec.rb
DELETED
@@ -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
|
-
|