rspec-core 2.0.0.beta.17 → 2.0.0.beta.18
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +5 -1
- data/Rakefile +4 -1
- data/Upgrade.markdown +28 -2
- data/VERSION +1 -1
- data/autotest/discover.rb +1 -1
- data/features/command_line/configure.feature +19 -0
- data/features/example_groups/shared_example_group.feature +125 -0
- data/features/hooks/around_hooks.feature +11 -2
- data/features/pending/pending_examples.feature +18 -6
- data/lib/autotest/rspec2.rb +1 -1
- data/lib/rspec/core.rb +1 -0
- data/lib/rspec/core/command_line_configuration.rb +62 -0
- data/lib/rspec/core/configuration.rb +39 -12
- data/lib/rspec/core/configuration_options.rb +5 -5
- data/lib/rspec/core/deprecation.rb +6 -6
- data/lib/rspec/core/errors.rb +1 -1
- data/lib/rspec/core/example.rb +25 -25
- data/lib/rspec/core/example_group.rb +30 -14
- data/lib/rspec/core/formatters/base_formatter.rb +25 -25
- data/lib/rspec/core/formatters/base_text_formatter.rb +11 -10
- data/lib/rspec/core/formatters/documentation_formatter.rb +2 -2
- data/lib/rspec/core/formatters/helpers.rb +6 -6
- data/lib/rspec/core/formatters/html_formatter.rb +13 -12
- data/lib/rspec/core/formatters/progress_formatter.rb +1 -1
- data/lib/rspec/core/formatters/snippet_extractor.rb +5 -5
- data/lib/rspec/core/hooks.rb +3 -3
- data/lib/rspec/core/kernel_extensions.rb +1 -1
- data/lib/rspec/core/let.rb +5 -5
- data/lib/rspec/core/metadata.rb +2 -2
- data/lib/rspec/core/mocking/with_absolutely_nothing.rb +3 -3
- data/lib/rspec/core/mocking/with_mocha.rb +5 -5
- data/lib/rspec/core/mocking/with_rr.rb +3 -3
- data/lib/rspec/core/mocking/with_rspec.rb +3 -3
- data/lib/rspec/core/option_parser.rb +8 -4
- data/lib/rspec/core/rake_task.rb +5 -0
- data/lib/rspec/core/ruby_project.rb +1 -1
- data/lib/rspec/core/shared_example_group.rb +2 -2
- data/lib/rspec/core/subject.rb +10 -4
- data/lib/rspec/core/world.rb +5 -5
- data/rspec-core.gemspec +19 -11
- data/spec/autotest/rspec_spec.rb +14 -14
- data/spec/rspec/core/command_line_configuration_spec.rb +26 -0
- data/spec/rspec/core/command_line_spec.rb +5 -5
- data/spec/rspec/core/configuration_options_spec.rb +20 -20
- data/spec/rspec/core/configuration_spec.rb +10 -10
- data/spec/rspec/core/core_spec.rb +8 -8
- data/spec/rspec/core/deprecations_spec.rb +2 -2
- data/spec/rspec/core/drb_command_line_spec.rb +10 -10
- data/spec/rspec/core/example_group_spec.rb +46 -10
- data/spec/rspec/core/example_spec.rb +46 -12
- data/spec/rspec/core/formatters/base_formatter_spec.rb +2 -46
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +4 -3
- data/spec/rspec/core/formatters/documentation_formatter_spec.rb +1 -1
- data/spec/rspec/core/formatters/helpers_spec.rb +2 -2
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +1 -1
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +1 -1
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +1 -1
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +10 -9
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +13 -13
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +1 -1
- data/spec/rspec/core/let_spec.rb +1 -1
- data/spec/rspec/core/metadata_spec.rb +9 -9
- data/spec/rspec/core/option_parser_spec.rb +3 -3
- data/spec/rspec/core/pending_example_spec.rb +1 -1
- data/spec/rspec/core/resources/custom_example_group_runner.rb +1 -1
- data/spec/rspec/core/runner_spec.rb +4 -4
- data/spec/rspec/core/shared_example_group_spec.rb +66 -162
- data/spec/rspec/core/subject_spec.rb +4 -4
- data/spec/rspec/core/world_spec.rb +38 -38
- metadata +21 -13
data/lib/rspec/core/world.rb
CHANGED
@@ -38,16 +38,16 @@ module RSpec
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def apply_inclusion_filters(examples, conditions={})
|
41
|
-
examples.select
|
41
|
+
examples.select(&all_apply?(conditions))
|
42
42
|
end
|
43
43
|
|
44
44
|
alias_method :find, :apply_inclusion_filters
|
45
45
|
|
46
46
|
def apply_exclusion_filters(examples, conditions={})
|
47
|
-
examples.reject
|
47
|
+
examples.reject(&all_apply?(conditions))
|
48
48
|
end
|
49
49
|
|
50
|
-
def preceding_declaration_line(filter_line)
|
50
|
+
def preceding_declaration_line(filter_line)
|
51
51
|
declaration_line_numbers.inject(nil) do |highest_prior_declaration_line, line|
|
52
52
|
line <= filter_line ? line : highest_prior_declaration_line
|
53
53
|
end
|
@@ -62,7 +62,7 @@ module RSpec
|
|
62
62
|
else
|
63
63
|
@configuration.reporter.message "Run filtered using #{inclusion_filter.inspect}"
|
64
64
|
end
|
65
|
-
end
|
65
|
+
end
|
66
66
|
end
|
67
67
|
|
68
68
|
include RSpec::Core::Hooks
|
@@ -82,7 +82,7 @@ module RSpec
|
|
82
82
|
lines + g.declaration_line_numbers
|
83
83
|
end
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
data/rspec-core.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-core}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.18"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Chad Humphries", "David Chelimsky"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-21}
|
13
13
|
s.default_executable = %q{rspec}
|
14
14
|
s.description = %q{RSpec runner and example groups}
|
15
15
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"bin/rspec",
|
33
33
|
"cucumber.yml",
|
34
34
|
"features/README.markdown",
|
35
|
+
"features/command_line/configure.feature",
|
35
36
|
"features/command_line/example_name_option.feature",
|
36
37
|
"features/command_line/exit_status.feature",
|
37
38
|
"features/command_line/line_number_appended_to_path.feature",
|
@@ -40,6 +41,7 @@ Gem::Specification.new do |s|
|
|
40
41
|
"features/configuration/options_file.feature",
|
41
42
|
"features/example_groups/describe_aliases.feature",
|
42
43
|
"features/example_groups/nested_groups.feature",
|
44
|
+
"features/example_groups/shared_example_group.feature",
|
43
45
|
"features/filtering/inclusion_filters.feature",
|
44
46
|
"features/formatters/custom_formatter.feature",
|
45
47
|
"features/hooks/around_hooks.feature",
|
@@ -60,6 +62,7 @@ Gem::Specification.new do |s|
|
|
60
62
|
"lib/rspec/core/around_proxy.rb",
|
61
63
|
"lib/rspec/core/backward_compatibility.rb",
|
62
64
|
"lib/rspec/core/command_line.rb",
|
65
|
+
"lib/rspec/core/command_line_configuration.rb",
|
63
66
|
"lib/rspec/core/configuration.rb",
|
64
67
|
"lib/rspec/core/configuration_options.rb",
|
65
68
|
"lib/rspec/core/deprecation.rb",
|
@@ -102,6 +105,7 @@ Gem::Specification.new do |s|
|
|
102
105
|
"script/console",
|
103
106
|
"spec/autotest/failed_results_re_spec.rb",
|
104
107
|
"spec/autotest/rspec_spec.rb",
|
108
|
+
"spec/rspec/core/command_line_configuration_spec.rb",
|
105
109
|
"spec/rspec/core/command_line_spec.rb",
|
106
110
|
"spec/rspec/core/command_line_spec_output.txt",
|
107
111
|
"spec/rspec/core/configuration_options_spec.rb",
|
@@ -149,18 +153,22 @@ Gem::Specification.new do |s|
|
|
149
153
|
s.homepage = %q{http://github.com/rspec/rspec-core}
|
150
154
|
s.post_install_message = %q{**************************************************
|
151
155
|
|
152
|
-
Thank you for installing rspec-core-2.0.0.beta.
|
153
|
-
|
156
|
+
Thank you for installing rspec-core-2.0.0.beta.18
|
157
|
+
|
158
|
+
Please be sure to look at Upgrade.markdown to see what might have changed
|
159
|
+
since the last release.
|
160
|
+
|
154
161
|
**************************************************
|
155
162
|
}
|
156
163
|
s.rdoc_options = ["--charset=UTF-8"]
|
157
164
|
s.require_paths = ["lib"]
|
158
165
|
s.rubyforge_project = %q{rspec}
|
159
166
|
s.rubygems_version = %q{1.3.7}
|
160
|
-
s.summary = %q{rspec-core-2.0.0.beta.
|
167
|
+
s.summary = %q{rspec-core-2.0.0.beta.18}
|
161
168
|
s.test_files = [
|
162
169
|
"spec/autotest/failed_results_re_spec.rb",
|
163
170
|
"spec/autotest/rspec_spec.rb",
|
171
|
+
"spec/rspec/core/command_line_configuration_spec.rb",
|
164
172
|
"spec/rspec/core/command_line_spec.rb",
|
165
173
|
"spec/rspec/core/configuration_options_spec.rb",
|
166
174
|
"spec/rspec/core/configuration_spec.rb",
|
@@ -204,19 +212,19 @@ Gem::Specification.new do |s|
|
|
204
212
|
s.specification_version = 3
|
205
213
|
|
206
214
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
207
|
-
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
208
|
-
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
215
|
+
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.18"])
|
216
|
+
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.18"])
|
209
217
|
s.add_development_dependency(%q<cucumber>, [">= 0.5.3"])
|
210
218
|
s.add_development_dependency(%q<autotest>, [">= 4.2.9"])
|
211
219
|
else
|
212
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
213
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
220
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.18"])
|
221
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.18"])
|
214
222
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
215
223
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
216
224
|
end
|
217
225
|
else
|
218
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
219
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
226
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.18"])
|
227
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.18"])
|
220
228
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
221
229
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
222
230
|
end
|
data/spec/autotest/rspec_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe Autotest::Rspec2 do
|
|
5
5
|
before(:each) do
|
6
6
|
@rspec_autotest = Autotest::Rspec2.new
|
7
7
|
@rspec_autotest.stub!(:ruby).and_return "ruby"
|
8
|
-
|
8
|
+
|
9
9
|
@ruby = @rspec_autotest.ruby
|
10
10
|
@spec_cmd = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'rspec'))
|
11
11
|
files = %w[file_one file_two]
|
@@ -17,7 +17,7 @@ describe Autotest::Rspec2 do
|
|
17
17
|
@rspec_autotest.files_to_test = @files_to_test
|
18
18
|
@to_test = files.map { |f| File.expand_path(f) }.join ' '
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
it "should make the appropriate test command" do
|
22
22
|
actual = @rspec_autotest.make_test_cmd(@files_to_test)
|
23
23
|
expected = /#{@ruby}.*#{@spec_cmd} (.*)/
|
@@ -35,26 +35,26 @@ describe Autotest::Rspec2 do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
describe "mappings" do
|
38
|
-
|
38
|
+
|
39
39
|
before(:each) do
|
40
40
|
@lib_file = "lib/something.rb"
|
41
41
|
@spec_file = "spec/something_spec.rb"
|
42
42
|
@rspec_autotest = Autotest::Rspec2.new
|
43
43
|
@rspec_autotest.hook :initialize
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
it "should find the spec file for a given lib file" do
|
47
47
|
@rspec_autotest.should map_specs([@spec_file]).to(@lib_file)
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
it "should find the spec file if given a spec file" do
|
51
51
|
@rspec_autotest.should map_specs([@spec_file]).to(@spec_file)
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
it "should ignore files in spec dir that aren't specs" do
|
55
55
|
@rspec_autotest.should map_specs([]).to("spec/spec_helper.rb")
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
it "should ignore untracked files (in @file)" do
|
59
59
|
@rspec_autotest.should map_specs([]).to("lib/untracked_file")
|
60
60
|
end
|
@@ -63,21 +63,21 @@ describe Autotest::Rspec2 do
|
|
63
63
|
describe "consolidating failures" do
|
64
64
|
before(:each) do
|
65
65
|
@rspec_autotest = Autotest::Rspec2.new
|
66
|
-
|
66
|
+
|
67
67
|
@spec_file = "spec/autotest/some_spec.rb"
|
68
68
|
@rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now})
|
69
69
|
@rspec_autotest.stub!(:find_files_to_test).and_return true
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
it "should return no failures if no failures were given in the output" do
|
73
73
|
@rspec_autotest.consolidate_failures([[]]).should == {}
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
it "should return a hash with the spec filename => spec name for each failure or error" do
|
77
77
|
@rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/some_spec.rb"
|
78
78
|
failures = [
|
79
79
|
[
|
80
|
-
"false should be false",
|
80
|
+
"false should be false",
|
81
81
|
"expected: true,\n got: false (using ==)\n#{@spec_file}:203:"
|
82
82
|
]
|
83
83
|
]
|
@@ -85,20 +85,20 @@ describe Autotest::Rspec2 do
|
|
85
85
|
@spec_file => ["false should be false"]
|
86
86
|
}
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
it "should not include the subject file" do
|
90
90
|
subject_file = "lib/autotest/some.rb"
|
91
91
|
@rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/some_spec.rb"
|
92
92
|
failures = [
|
93
93
|
[
|
94
|
-
"false should be false",
|
94
|
+
"false should be false",
|
95
95
|
"expected: true,\n got: false (using ==)\n#{subject_file}:143:\n#{@spec_file}:203:"
|
96
96
|
]
|
97
97
|
]
|
98
98
|
@rspec_autotest.consolidate_failures(failures).keys.should_not include(subject_file)
|
99
99
|
end
|
100
100
|
end
|
101
|
-
|
101
|
+
|
102
102
|
describe "normalizing file names" do
|
103
103
|
it "should ensure that a single file appears in files_to_test only once" do
|
104
104
|
@rspec_autotest = Autotest::Rspec2.new
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module RSpec::Core
|
4
|
+
describe CommandLineConfiguration do
|
5
|
+
describe '#run' do
|
6
|
+
context 'given autotest command' do
|
7
|
+
let(:config) { CommandLineConfiguration.new('autotest') }
|
8
|
+
|
9
|
+
it 'calls Autotest.generate' do
|
10
|
+
CommandLineConfiguration::Autotest.should_receive(:generate)
|
11
|
+
config.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'given unsupported command' do
|
16
|
+
let(:config) { CommandLineConfiguration.new('unsupported') }
|
17
|
+
|
18
|
+
it 'raises ArgumentError' do
|
19
|
+
lambda { config.run }.should(
|
20
|
+
raise_error(ArgumentError, /"unsupported" is not valid/)
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -71,7 +71,7 @@ module RSpec::Core
|
|
71
71
|
after_suite_called.should be_true
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
describe "#run with custom output" do
|
76
76
|
let(:config_options) do
|
77
77
|
config_options = ConfigurationOptions.new(%w[--color])
|
@@ -86,11 +86,11 @@ module RSpec::Core
|
|
86
86
|
let(:output_file_path) do
|
87
87
|
Dir.tmpdir + "/command_line_spec_output.txt"
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
let(:output_file) do
|
91
91
|
File.new(output_file_path, 'w')
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
let(:config) do
|
95
95
|
config = RSpec::Core::Configuration.new
|
96
96
|
config.output_stream = output_file
|
@@ -102,12 +102,12 @@ module RSpec::Core
|
|
102
102
|
before do
|
103
103
|
config.stub(:run_hook)
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
it "doesn't override output_stream" do
|
107
107
|
command_line.run(out, out)
|
108
108
|
command_line.instance_eval { @configuration.output_stream }.should eql(output_file)
|
109
109
|
end
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
end
|
113
113
|
end
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
require 'ostruct'
|
4
4
|
|
5
5
|
describe RSpec::Core::ConfigurationOptions do
|
6
|
-
|
6
|
+
|
7
7
|
def config_options_object(*args)
|
8
8
|
coo = RSpec::Core::ConfigurationOptions.new(args)
|
9
9
|
coo.parse_options
|
@@ -22,7 +22,7 @@ describe RSpec::Core::ConfigurationOptions do
|
|
22
22
|
config.should_receive(:requires=).ordered
|
23
23
|
opts.configure(config)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
it "sends requires before formatter" do
|
27
27
|
opts = config_options_object(*%w[--require a/path -f a/formatter])
|
28
28
|
config = double("config").as_null_object
|
@@ -122,7 +122,7 @@ describe RSpec::Core::ConfigurationOptions do
|
|
122
122
|
|
123
123
|
it "parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'" do
|
124
124
|
options_from_args("dir", "spec/file1_spec.rb", "spec/file2_spec.rb").should include(:files_or_directories_to_run => ["dir", "spec/file1_spec.rb", "spec/file2_spec.rb"])
|
125
|
-
|
125
|
+
|
126
126
|
end
|
127
127
|
|
128
128
|
end
|
@@ -140,7 +140,7 @@ describe RSpec::Core::ConfigurationOptions do
|
|
140
140
|
options_from_args("-d").should include(:debug => true)
|
141
141
|
end
|
142
142
|
end
|
143
|
-
|
143
|
+
|
144
144
|
describe "--drb (-X)" do
|
145
145
|
context "combined with --debug" do
|
146
146
|
it "turns off the debugger if --drb is specified first" do
|
@@ -149,35 +149,35 @@ describe RSpec::Core::ConfigurationOptions do
|
|
149
149
|
config_options_object("-X", "--debug").drb_argv.should_not include("--debug")
|
150
150
|
config_options_object("-X", "-d" ).drb_argv.should_not include("--debug")
|
151
151
|
end
|
152
|
-
|
153
|
-
it "turns off the debugger option if --drb is specified later" do
|
152
|
+
|
153
|
+
it "turns off the debugger option if --drb is specified later" do
|
154
154
|
config_options_object("--debug", "--drb").drb_argv.should_not include("--debug")
|
155
155
|
config_options_object("-d", "--drb").drb_argv.should_not include("--debug")
|
156
156
|
config_options_object("--debug", "-X" ).drb_argv.should_not include("--debug")
|
157
157
|
config_options_object("-d", "-X" ).drb_argv.should_not include("--debug")
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
it "turns off the debugger option if --drb is specified in the options file" do
|
161
161
|
File.stub(:exist?) { true }
|
162
162
|
File.stub(:readlines) { %w[ --drb ] }
|
163
163
|
config_options_object("--debug").drb_argv.should_not include("--debug")
|
164
|
-
config_options_object("-d" ).drb_argv.should_not include("--debug")
|
164
|
+
config_options_object("-d" ).drb_argv.should_not include("--debug")
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
it "turns off the debugger option if --debug is specified in the options file" do
|
168
168
|
File.stub(:exist?) { true }
|
169
169
|
File.stub(:readlines) { %w[ --debug ] }
|
170
170
|
config_options_object("--drb").drb_argv.should_not include("--debug")
|
171
|
-
config_options_object("-X" ).drb_argv.should_not include("--debug")
|
171
|
+
config_options_object("-X" ).drb_argv.should_not include("--debug")
|
172
172
|
end
|
173
173
|
end
|
174
|
-
|
174
|
+
|
175
175
|
it "sends all the arguments other than --drb back to the parser after parsing options" do
|
176
176
|
config_options_object("--drb", "--color").drb_argv.should_not include("--drb")
|
177
177
|
end
|
178
178
|
end
|
179
|
-
|
180
|
-
|
179
|
+
|
180
|
+
|
181
181
|
# TODO #drb_argv may not be the best name
|
182
182
|
# TODO ensure all options are output
|
183
183
|
# TODO check if we need to spec that the short options are "expanded" ("-v" becomes "--version" currently)
|
@@ -186,7 +186,7 @@ describe RSpec::Core::ConfigurationOptions do
|
|
186
186
|
File.stub(:exist?) { false }
|
187
187
|
config_options_object(*%w[ a --drb b --color c ]).drb_argv.should =~ %w[ --color a b c ]
|
188
188
|
end
|
189
|
-
|
189
|
+
|
190
190
|
context "--drb specified in ARGV" do
|
191
191
|
it "renders all the original arguments except --drb" do
|
192
192
|
config_options_object(*%w[ --drb --color --format s --line_number 1 --example pattern --profile --backtrace -I path/a -I path/b --require path/c --require path/d]).
|
@@ -234,7 +234,7 @@ describe RSpec::Core::ConfigurationOptions do
|
|
234
234
|
config_options.configure(config)
|
235
235
|
config.formatter.should == 'doc'
|
236
236
|
end
|
237
|
-
|
237
|
+
|
238
238
|
it "allows options on one line" do
|
239
239
|
File.stub(:exist?) { true }
|
240
240
|
File.stub(:readlines) { ["--format doc"] }
|
@@ -244,13 +244,13 @@ describe RSpec::Core::ConfigurationOptions do
|
|
244
244
|
config_options.configure(config)
|
245
245
|
config.formatter.should == 'doc'
|
246
246
|
end
|
247
|
-
|
247
|
+
|
248
248
|
it "merges options from the global and local .rspec and the command line" do
|
249
249
|
File.stub(:exist?){ true }
|
250
250
|
File.stub(:readlines) do |path|
|
251
251
|
case path
|
252
252
|
when ".rspec"
|
253
|
-
["--format", "documentation"]
|
253
|
+
["--format", "documentation"]
|
254
254
|
when /\.rspec/
|
255
255
|
["--line", "37"]
|
256
256
|
else
|
@@ -266,15 +266,15 @@ describe RSpec::Core::ConfigurationOptions do
|
|
266
266
|
config.line_number.should == "37"
|
267
267
|
config.color_enabled.should be_false
|
268
268
|
end
|
269
|
-
|
269
|
+
|
270
270
|
it "prefers local options over global" do
|
271
271
|
File.stub(:exist?){ true }
|
272
272
|
File.stub(:readlines) do |path|
|
273
273
|
case path
|
274
274
|
when ".rspec"
|
275
|
-
["--format", "local"]
|
275
|
+
["--format", "local"]
|
276
276
|
when /\.rspec/
|
277
|
-
["--format", "global"]
|
277
|
+
["--format", "global"]
|
278
278
|
else
|
279
279
|
raise "Unexpected path: #{path}"
|
280
280
|
end
|
@@ -35,9 +35,9 @@ module RSpec::Core
|
|
35
35
|
config.mock_with :rspec
|
36
36
|
config.require_mock_framework_adapter
|
37
37
|
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
41
|
context "setting the files to run" do
|
42
42
|
|
43
43
|
it "loads files not following pattern if named explicitly" do
|
@@ -85,7 +85,7 @@ module RSpec::Core
|
|
85
85
|
config.files_or_directories_to_run = dir
|
86
86
|
config.files_to_run.should_not include("#{dir}/a_bar.rb")
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
end
|
90
90
|
|
91
91
|
context "with explicit pattern (comma,separated,values)" do
|
@@ -129,7 +129,7 @@ module RSpec::Core
|
|
129
129
|
end
|
130
130
|
|
131
131
|
end
|
132
|
-
|
132
|
+
|
133
133
|
describe "include" do
|
134
134
|
|
135
135
|
module InstanceLevelMethods
|
@@ -173,7 +173,7 @@ module RSpec::Core
|
|
173
173
|
|
174
174
|
it "should extend the given module into each matching example group" do
|
175
175
|
RSpec.configure do |c|
|
176
|
-
c.extend(ThatThingISentYou, :magic_key => :extend)
|
176
|
+
c.extend(ThatThingISentYou, :magic_key => :extend)
|
177
177
|
end
|
178
178
|
|
179
179
|
group = ExampleGroup.describe(ThatThingISentYou, :magic_key => :extend) { }
|
@@ -229,7 +229,7 @@ module RSpec::Core
|
|
229
229
|
it "warns to install win32console" do
|
230
230
|
config.stub(:require) { raise LoadError }
|
231
231
|
config.should_receive(:warn).
|
232
|
-
with
|
232
|
+
with(/You must 'gem install win32console'/)
|
233
233
|
config.color_enabled = true
|
234
234
|
end
|
235
235
|
|
@@ -242,7 +242,7 @@ module RSpec::Core
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
end
|
245
|
-
|
245
|
+
|
246
246
|
describe 'formatter=' do
|
247
247
|
|
248
248
|
it "sets formatter_to_use based on name" do
|
@@ -257,7 +257,7 @@ module RSpec::Core
|
|
257
257
|
config.formatter = formatter_class
|
258
258
|
config.formatter.should be_an_instance_of(formatter_class)
|
259
259
|
end
|
260
|
-
|
260
|
+
|
261
261
|
it "sets a formatter based on its class name" do
|
262
262
|
Object.const_set("CustomFormatter", Class.new(Formatters::BaseFormatter))
|
263
263
|
config.formatter = "CustomFormatter"
|
@@ -273,7 +273,7 @@ module RSpec::Core
|
|
273
273
|
it "raises ArgumentError if formatter is unknown" do
|
274
274
|
lambda { config.formatter = :progresss }.should raise_error(ArgumentError)
|
275
275
|
end
|
276
|
-
|
276
|
+
|
277
277
|
end
|
278
278
|
|
279
279
|
describe "#filter_run" do
|