rspec-core 2.14.8 → 2.99.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Changelog.md +54 -8
- data/features/command_line/order.feature +5 -8
- data/features/configuration/custom_settings.feature +10 -10
- data/features/configuration/deprecation_stream.feature +3 -3
- data/features/configuration/read_options_from_file.feature +1 -1
- data/features/example_groups/shared_examples.feature +2 -2
- data/features/hooks/around_hooks.feature +1 -1
- data/features/metadata/current_example.feature +43 -4
- data/features/metadata/user_defined.feature +12 -12
- data/lib/autotest/rspec2.rb +60 -56
- data/lib/rspec/core.rb +40 -2
- data/lib/rspec/core/caller_filter.rb +55 -0
- data/lib/rspec/core/command_line.rb +2 -2
- data/lib/rspec/core/configuration.rb +201 -13
- data/lib/rspec/core/deprecation.rb +2 -7
- data/lib/rspec/core/example.rb +5 -8
- data/lib/rspec/core/example_group.rb +101 -17
- data/lib/rspec/core/filter_manager.rb +2 -2
- data/lib/rspec/core/formatters/deprecation_formatter.rb +173 -15
- data/lib/rspec/core/formatters/text_mate_formatter.rb +0 -12
- data/lib/rspec/core/hooks.rb +1 -1
- data/lib/rspec/core/memoized_helpers.rb +49 -17
- data/lib/rspec/core/metadata.rb +1 -1
- data/lib/rspec/core/option_parser.rb +8 -3
- data/lib/rspec/core/pending.rb +14 -10
- data/lib/rspec/core/rake_task.rb +30 -6
- data/lib/rspec/core/runner.rb +9 -0
- data/lib/rspec/core/shared_example_group.rb +11 -9
- data/lib/rspec/core/shared_example_group/collection.rb +3 -1
- data/lib/rspec/core/version.rb +1 -2
- data/spec/command_line/order_spec.rb +4 -4
- data/spec/rspec/core/backtrace_cleaner_spec.rb +10 -10
- data/spec/rspec/core/caller_filter_spec.rb +58 -0
- data/spec/rspec/core/command_line_spec.rb +1 -0
- data/spec/rspec/core/configuration_options_spec.rb +6 -6
- data/spec/rspec/core/configuration_spec.rb +285 -52
- data/spec/rspec/core/deprecation_spec.rb +10 -29
- data/spec/rspec/core/deprecations_spec.rb +0 -14
- data/spec/rspec/core/example_group_spec.rb +74 -56
- data/spec/rspec/core/example_spec.rb +54 -17
- data/spec/rspec/core/filter_manager_spec.rb +2 -2
- data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +156 -52
- data/spec/rspec/core/formatters/html_formatter_spec.rb +1 -1
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +1 -2
- data/spec/rspec/core/hooks_spec.rb +2 -0
- data/spec/rspec/core/memoized_helpers_spec.rb +154 -113
- data/spec/rspec/core/metadata_spec.rb +25 -25
- data/spec/rspec/core/option_parser_spec.rb +19 -1
- data/spec/rspec/core/project_initializer_spec.rb +4 -4
- data/spec/rspec/core/rake_task_spec.rb +25 -4
- data/spec/rspec/core/shared_context_spec.rb +4 -4
- data/spec/rspec/core/shared_example_group_spec.rb +1 -1
- data/spec/rspec/core_spec.rb +36 -2
- data/spec/spec_helper.rb +3 -0
- data/spec/support/helper_methods.rb +16 -1
- data/spec/support/shared_example_groups.rb +1 -0
- data/spec/support/silence_dsl_deprecations.rb +32 -0
- metadata +10 -7
- data/spec/rspec/core/formatters/text_mate_formatted-2.1.0.html +0 -425
@@ -69,27 +69,27 @@ module RSpec
|
|
69
69
|
it "matches the group when the line_number is the example group line number" do
|
70
70
|
# this call doesn't really make sense since filter_applies? is only called
|
71
71
|
# for example metadata not group metadata
|
72
|
-
expect(group_metadata.filter_applies?(condition_key, group_condition)).to
|
72
|
+
expect(group_metadata.filter_applies?(condition_key, group_condition)).to be_truthy
|
73
73
|
end
|
74
74
|
|
75
75
|
it "matches the example when the line_number is the grandparent example group line number" do
|
76
|
-
expect(example_metadata.filter_applies?(condition_key, parent_group_condition)).to
|
76
|
+
expect(example_metadata.filter_applies?(condition_key, parent_group_condition)).to be_truthy
|
77
77
|
end
|
78
78
|
|
79
79
|
it "matches the example when the line_number is the parent example group line number" do
|
80
|
-
expect(example_metadata.filter_applies?(condition_key, group_condition)).to
|
80
|
+
expect(example_metadata.filter_applies?(condition_key, group_condition)).to be_truthy
|
81
81
|
end
|
82
82
|
|
83
83
|
it "matches the example when the line_number is the example line number" do
|
84
|
-
expect(example_metadata.filter_applies?(condition_key, example_condition)).to
|
84
|
+
expect(example_metadata.filter_applies?(condition_key, example_condition)).to be_truthy
|
85
85
|
end
|
86
86
|
|
87
87
|
it "matches when the line number is between this example and the next" do
|
88
|
-
expect(example_metadata.filter_applies?(condition_key, between_examples_condition)).to
|
88
|
+
expect(example_metadata.filter_applies?(condition_key, between_examples_condition)).to be_truthy
|
89
89
|
end
|
90
90
|
|
91
91
|
it "does not match when the line number matches the next example" do
|
92
|
-
expect(example_metadata.filter_applies?(condition_key, next_example_condition)).to
|
92
|
+
expect(example_metadata.filter_applies?(condition_key, next_example_condition)).to be_falsey
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -136,25 +136,25 @@ module RSpec
|
|
136
136
|
it_has_behavior "matching by line number"
|
137
137
|
|
138
138
|
it "ignores location filters for other files" do
|
139
|
-
expect(example_metadata.filter_applies?(:locations, {"/path/to/other_spec.rb" => [3,5,7]})).to
|
139
|
+
expect(example_metadata.filter_applies?(:locations, {"/path/to/other_spec.rb" => [3,5,7]})).to be_truthy
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
143
|
it "matches a proc with no arguments that evaluates to true" do
|
144
|
-
expect(example_metadata.filter_applies?(:if, lambda { true })).to
|
144
|
+
expect(example_metadata.filter_applies?(:if, lambda { true })).to be_truthy
|
145
145
|
end
|
146
146
|
|
147
147
|
it "matches a proc that evaluates to true" do
|
148
|
-
expect(example_metadata.filter_applies?(:if, lambda { |v| v })).to
|
148
|
+
expect(example_metadata.filter_applies?(:if, lambda { |v| v })).to be_truthy
|
149
149
|
end
|
150
150
|
|
151
151
|
it "does not match a proc that evaluates to false" do
|
152
|
-
expect(example_metadata.filter_applies?(:if, lambda { |v| !v })).to
|
152
|
+
expect(example_metadata.filter_applies?(:if, lambda { |v| !v })).to be_falsey
|
153
153
|
end
|
154
154
|
|
155
155
|
it "matches a proc with an arity of 2" do
|
156
156
|
example_metadata[:foo] = nil
|
157
|
-
expect(example_metadata.filter_applies?(:foo, lambda { |v, m| m == example_metadata })).to
|
157
|
+
expect(example_metadata.filter_applies?(:foo, lambda { |v, m| m == example_metadata })).to be_truthy
|
158
158
|
end
|
159
159
|
|
160
160
|
it "raises an error when the proc has an incorrect arity" do
|
@@ -169,35 +169,35 @@ module RSpec
|
|
169
169
|
}
|
170
170
|
|
171
171
|
it "matches a symbol" do
|
172
|
-
expect(metadata_with_array.filter_applies?(:tag, 'one')).to
|
173
|
-
expect(metadata_with_array.filter_applies?(:tag, :one)).to
|
174
|
-
expect(metadata_with_array.filter_applies?(:tag, 'two')).to
|
172
|
+
expect(metadata_with_array.filter_applies?(:tag, 'one')).to be_truthy
|
173
|
+
expect(metadata_with_array.filter_applies?(:tag, :one)).to be_truthy
|
174
|
+
expect(metadata_with_array.filter_applies?(:tag, 'two')).to be_falsey
|
175
175
|
end
|
176
176
|
|
177
177
|
it "matches a string" do
|
178
|
-
expect(metadata_with_array.filter_applies?(:tag, 'three')).to
|
179
|
-
expect(metadata_with_array.filter_applies?(:tag, :three)).to
|
180
|
-
expect(metadata_with_array.filter_applies?(:tag, 'tree')).to
|
178
|
+
expect(metadata_with_array.filter_applies?(:tag, 'three')).to be_truthy
|
179
|
+
expect(metadata_with_array.filter_applies?(:tag, :three)).to be_truthy
|
180
|
+
expect(metadata_with_array.filter_applies?(:tag, 'tree')).to be_falsey
|
181
181
|
end
|
182
182
|
|
183
183
|
it "matches an integer" do
|
184
|
-
expect(metadata_with_array.filter_applies?(:tag, '2')).to
|
185
|
-
expect(metadata_with_array.filter_applies?(:tag, 2)).to
|
186
|
-
expect(metadata_with_array.filter_applies?(:tag, 3)).to
|
184
|
+
expect(metadata_with_array.filter_applies?(:tag, '2')).to be_truthy
|
185
|
+
expect(metadata_with_array.filter_applies?(:tag, 2)).to be_truthy
|
186
|
+
expect(metadata_with_array.filter_applies?(:tag, 3)).to be_falsey
|
187
187
|
end
|
188
188
|
|
189
189
|
it "matches a regexp" do
|
190
|
-
expect(metadata_with_array.filter_applies?(:tag, 'four')).to
|
191
|
-
expect(metadata_with_array.filter_applies?(:tag, 'fourtune')).to
|
192
|
-
expect(metadata_with_array.filter_applies?(:tag, 'fortune')).to
|
190
|
+
expect(metadata_with_array.filter_applies?(:tag, 'four')).to be_truthy
|
191
|
+
expect(metadata_with_array.filter_applies?(:tag, 'fourtune')).to be_truthy
|
192
|
+
expect(metadata_with_array.filter_applies?(:tag, 'fortune')).to be_falsey
|
193
193
|
end
|
194
194
|
|
195
195
|
it "matches a proc that evaluates to true" do
|
196
|
-
expect(metadata_with_array.filter_applies?(:tag, lambda { |values| values.include? 'three' })).to
|
196
|
+
expect(metadata_with_array.filter_applies?(:tag, lambda { |values| values.include? 'three' })).to be_truthy
|
197
197
|
end
|
198
198
|
|
199
199
|
it "does not match a proc that evaluates to false" do
|
200
|
-
expect(metadata_with_array.filter_applies?(:tag, lambda { |values| values.include? 'nothing' })).to
|
200
|
+
expect(metadata_with_array.filter_applies?(:tag, lambda { |values| values.include? 'nothing' })).to be_falsey
|
201
201
|
end
|
202
202
|
end
|
203
203
|
end
|
@@ -5,7 +5,6 @@ module RSpec::Core
|
|
5
5
|
let(:output_file){ mock File }
|
6
6
|
|
7
7
|
before do
|
8
|
-
RSpec.stub(:deprecate)
|
9
8
|
File.stub(:open).with("foo.txt",'w') { (output_file) }
|
10
9
|
end
|
11
10
|
|
@@ -196,6 +195,25 @@ module RSpec::Core
|
|
196
195
|
end
|
197
196
|
end
|
198
197
|
end
|
198
|
+
|
199
|
+
context "with default" do
|
200
|
+
it 'defines the order as defined' do
|
201
|
+
options = Parser.parse!(['--order', 'default'])
|
202
|
+
expect(options[:order]).to eq('defined')
|
203
|
+
end
|
204
|
+
|
205
|
+
it 'prints a deprecation warning' do
|
206
|
+
expect_deprecation_with_no_call_site(/default/)
|
207
|
+
Parser.parse!(['--order', 'default'])
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
context "with defined" do
|
212
|
+
it 'defines the order as defined' do
|
213
|
+
options = Parser.parse!(['--order', 'defined'])
|
214
|
+
expect(options[:order]).to eq('defined')
|
215
|
+
end
|
216
|
+
end
|
199
217
|
end
|
200
218
|
|
201
219
|
describe "--seed" do
|
@@ -82,13 +82,13 @@ module RSpec::Core
|
|
82
82
|
it "removes it if confirmed" do
|
83
83
|
command_line_config.stub(:gets => 'yes')
|
84
84
|
command_line_config.run
|
85
|
-
expect(File.exist?('autotest/discover.rb')).to
|
85
|
+
expect(File.exist?('autotest/discover.rb')).to be_falsey
|
86
86
|
end
|
87
87
|
|
88
88
|
it "leaves it if not confirmed" do
|
89
89
|
command_line_config.stub(:gets => 'no')
|
90
90
|
command_line_config.run
|
91
|
-
expect(File.exist?('autotest/discover.rb')).to
|
91
|
+
expect(File.exist?('autotest/discover.rb')).to be_truthy
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -106,13 +106,13 @@ module RSpec::Core
|
|
106
106
|
it "removes it if confirmed" do
|
107
107
|
command_line_config.stub(:gets => 'yes')
|
108
108
|
command_line_config.run
|
109
|
-
expect(File.exist?('lib/tasks/rspec.rake')).to
|
109
|
+
expect(File.exist?('lib/tasks/rspec.rake')).to be_falsey
|
110
110
|
end
|
111
111
|
|
112
112
|
it "leaves it if not confirmed" do
|
113
113
|
command_line_config.stub(:gets => 'no')
|
114
114
|
command_line_config.run
|
115
|
-
expect(File.exist?('lib/tasks/rspec.rake')).to
|
115
|
+
expect(File.exist?('lib/tasks/rspec.rake')).to be_truthy
|
116
116
|
end
|
117
117
|
end
|
118
118
|
end
|
@@ -34,7 +34,7 @@ module RSpec::Core
|
|
34
34
|
end
|
35
35
|
|
36
36
|
task.should_receive(:run_task) { true }
|
37
|
-
expect(Rake.application.invoke_task("rake_task_args[first_spec.rb]")).to
|
37
|
+
expect(Rake.application.invoke_task("rake_task_args[first_spec.rb]")).to be_truthy
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -45,26 +45,40 @@ module RSpec::Core
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context "with rcov" do
|
48
|
+
before { allow(RSpec).to receive(:deprecate) }
|
49
|
+
|
48
50
|
it "renders rcov" do
|
49
51
|
with_rcov do
|
50
52
|
expect(spec_command).to match(/^#{ruby} -S rcov/)
|
51
53
|
end
|
52
54
|
end
|
55
|
+
|
56
|
+
it 'warns of deprecation' do
|
57
|
+
expect(RSpec).to receive(:deprecate)
|
58
|
+
with_rcov { spec_command }
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
context "with ruby options" do
|
56
63
|
it "renders them before -S" do
|
57
|
-
|
58
|
-
|
64
|
+
task.ruby_opts = "-w"
|
65
|
+
expect(spec_command).to match(/^#{ruby} -w -S rspec/)
|
59
66
|
end
|
60
67
|
end
|
61
68
|
|
62
69
|
context "with rcov_opts" do
|
70
|
+
before { allow(RSpec).to receive(:deprecate) }
|
71
|
+
|
63
72
|
context "with rcov=false (default)" do
|
64
73
|
it "does not add the rcov options to the command" do
|
65
74
|
task.rcov_opts = '--exclude "mocks"'
|
66
75
|
expect(spec_command).not_to match(/--exclude "mocks"/)
|
67
76
|
end
|
77
|
+
|
78
|
+
it 'warns of deprecation' do
|
79
|
+
expect(RSpec).to receive(:deprecate)
|
80
|
+
task.rcov_opts = '--exclude "mocks"'
|
81
|
+
end
|
68
82
|
end
|
69
83
|
|
70
84
|
context "with rcov=true" do
|
@@ -79,10 +93,17 @@ module RSpec::Core
|
|
79
93
|
task.rcov_opts = '--exclude "mocks"'
|
80
94
|
expect(spec_command).to match(/rcov.*-Ispec:lib/)
|
81
95
|
end
|
96
|
+
|
97
|
+
it 'warns of deprecation' do
|
98
|
+
expect(RSpec).to receive(:deprecate)
|
99
|
+
task.rcov_opts = '--exclude "mocks"'
|
100
|
+
end
|
82
101
|
end
|
83
102
|
end
|
84
103
|
|
85
104
|
context "with rspec_opts" do
|
105
|
+
before { allow(RSpec).to receive(:deprecate) }
|
106
|
+
|
86
107
|
context "with rcov=true" do
|
87
108
|
it "adds the rspec_opts after the rcov_opts and files" do
|
88
109
|
task.stub(:files_to_run) { "this.rb that.rb" }
|
@@ -134,7 +155,7 @@ module RSpec::Core
|
|
134
155
|
# since the config block is deferred til task invocation, must fake
|
135
156
|
# calling the task so the expected pattern is picked up
|
136
157
|
task.should_receive(:run_task) { true }
|
137
|
-
expect(Rake.application.invoke_task(task.name)).to
|
158
|
+
expect(Rake.application.invoke_task(task.name)).to be_truthy
|
138
159
|
|
139
160
|
specify_consistent_ordering_of_files_to_run('a/*.rb', task)
|
140
161
|
end
|
@@ -28,10 +28,10 @@ describe RSpec::SharedContext do
|
|
28
28
|
|
29
29
|
group.run
|
30
30
|
|
31
|
-
expect(before_all_hook).to
|
32
|
-
expect(before_each_hook).to
|
33
|
-
expect(after_each_hook).to
|
34
|
-
expect(after_all_hook).to
|
31
|
+
expect(before_all_hook).to be_truthy
|
32
|
+
expect(before_each_hook).to be_truthy
|
33
|
+
expect(after_each_hook).to be_truthy
|
34
|
+
expect(after_all_hook).to be_truthy
|
35
35
|
end
|
36
36
|
|
37
37
|
it "runs the before each hooks in configuration before those of the shared context" do
|
@@ -51,7 +51,7 @@ module RSpec::Core
|
|
51
51
|
|
52
52
|
it 'works with top level defined examples in modules' do
|
53
53
|
expect(RSpec::configuration.reporter).to_not receive(:deprecation)
|
54
|
-
|
54
|
+
ExampleGroup.describe('example group') { include_context 'top level in module' }
|
55
55
|
end
|
56
56
|
|
57
57
|
["name", :name, ExampleModule, ExampleClass].each do |object|
|
data/spec/rspec/core_spec.rb
CHANGED
@@ -41,6 +41,16 @@ describe RSpec do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
describe ".current_example" do
|
45
|
+
it "sets the example being executed" do
|
46
|
+
group = RSpec::Core::ExampleGroup.describe("an example group")
|
47
|
+
example = group.example("an example")
|
48
|
+
|
49
|
+
RSpec.current_example = example
|
50
|
+
expect(RSpec.current_example).to be(example)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
44
54
|
describe "::reset" do
|
45
55
|
it "resets the configuration and world objects" do
|
46
56
|
config_before_reset = RSpec.configuration
|
@@ -53,6 +63,12 @@ describe RSpec do
|
|
53
63
|
end
|
54
64
|
end
|
55
65
|
|
66
|
+
describe "::Core.path_to_executable" do
|
67
|
+
it 'returns the absolute location of the exe/rspec file' do
|
68
|
+
expect(RSpec::Core.path_to_executable).to eq File.expand_path('../../../exe/rspec',__FILE__)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
56
72
|
# This is hard to test :(. Best way I could come up with was starting
|
57
73
|
# fresh ruby process w/o this stuff already loaded.
|
58
74
|
it "loads mocks and expectations when the constants are referenced" do
|
@@ -68,7 +84,25 @@ describe RSpec do
|
|
68
84
|
it 'correctly raises an error when an invalid const is referenced' do
|
69
85
|
expect {
|
70
86
|
RSpec::NotAConst
|
71
|
-
}.to raise_error(NameError, /
|
87
|
+
}.to raise_error(NameError, /RSpec::NotAConst/)
|
72
88
|
end
|
73
|
-
end
|
74
89
|
|
90
|
+
describe "::Core::PendingExampleFixedError" do
|
91
|
+
before { allow_deprecation }
|
92
|
+
|
93
|
+
it 'is an alternate reference to RSpec::Core::Pending::PendingExampleFixedError' do
|
94
|
+
expect(::RSpec::Core::PendingExampleFixedError).to be(::RSpec::Core::Pending::PendingExampleFixedError)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'prints a deprecation warning' do
|
98
|
+
expect_deprecation_with_call_site(__FILE__, __LINE__ + 1, /PendingExampleFixedError/)
|
99
|
+
::RSpec::Core::PendingExampleFixedError
|
100
|
+
end
|
101
|
+
|
102
|
+
specify 'the const_missing hook allows other undefined consts to raise errors as normal' do
|
103
|
+
expect {
|
104
|
+
::RSpec::Core::SomeUndefinedConst
|
105
|
+
}.to raise_error(NameError, /uninitialized constant RSpec::Core::SomeUndefinedConst/)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -39,6 +39,7 @@ Spork.prefork do
|
|
39
39
|
def self.sandboxed(&block)
|
40
40
|
@orig_config = RSpec.configuration
|
41
41
|
@orig_world = RSpec.world
|
42
|
+
@orig_example = RSpec.current_example
|
42
43
|
new_config = RSpec::Core::Configuration.new
|
43
44
|
new_world = RSpec::Core::World.new(new_config)
|
44
45
|
RSpec.configuration = new_config
|
@@ -49,6 +50,7 @@ Spork.prefork do
|
|
49
50
|
(class << RSpec::Core::ExampleGroup; self; end).class_eval do
|
50
51
|
alias_method :orig_run, :run
|
51
52
|
def run(reporter=nil)
|
53
|
+
RSpec.current_example = nil
|
52
54
|
orig_run(reporter || NullObject.new)
|
53
55
|
end
|
54
56
|
end
|
@@ -65,6 +67,7 @@ Spork.prefork do
|
|
65
67
|
|
66
68
|
RSpec.configuration = @orig_config
|
67
69
|
RSpec.world = @orig_world
|
70
|
+
RSpec.current_example = @orig_example
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
@@ -23,9 +23,24 @@ module RSpecHelpers
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def expect_deprecation_with_call_site(file, line)
|
26
|
+
def expect_deprecation_with_call_site(file, line, deprecated = //)
|
27
27
|
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
28
28
|
expect(options[:call_site]).to include([file, line].join(':'))
|
29
|
+
expect(options[:deprecated]).to match(deprecated)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def expect_deprecation_with_no_call_site(deprecated)
|
34
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
35
|
+
expect(options).to include(:call_site => nil)
|
36
|
+
expect(options[:deprecated]).to match(deprecated)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def expect_warn_deprecation_with_call_site(file, line, deprecated = //)
|
41
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
42
|
+
expect(options[:message]).to include([file, line].join(':'))
|
43
|
+
expect(options[:message]).to match(deprecated)
|
29
44
|
end
|
30
45
|
end
|
31
46
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SilenceDSLDeprecations
|
2
|
+
class Reporter
|
3
|
+
def initialize(reporter)
|
4
|
+
@reporter = reporter
|
5
|
+
end
|
6
|
+
|
7
|
+
def deprecation(*)
|
8
|
+
# do nothing
|
9
|
+
end
|
10
|
+
|
11
|
+
def respond_to?(*args)
|
12
|
+
@repoter.respond_to?(*args) || super
|
13
|
+
end
|
14
|
+
|
15
|
+
def method_missing(*args, &block)
|
16
|
+
@reporter.__send__(*args, &block)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def silence_dsl_deprecations
|
21
|
+
old_reporter = RSpec.configuration.reporter
|
22
|
+
replace_reporter(Reporter.new(old_reporter))
|
23
|
+
yield
|
24
|
+
ensure
|
25
|
+
replace_reporter(old_reporter)
|
26
|
+
end
|
27
|
+
|
28
|
+
def replace_reporter(new_reporter)
|
29
|
+
RSpec.configuration.instance_variable_set(:@reporter, new_reporter)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.99.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/rspec/core.rb
|
153
153
|
- lib/rspec/core/backtrace_cleaner.rb
|
154
154
|
- lib/rspec/core/backward_compatibility.rb
|
155
|
+
- lib/rspec/core/caller_filter.rb
|
155
156
|
- lib/rspec/core/command_line.rb
|
156
157
|
- lib/rspec/core/configuration.rb
|
157
158
|
- lib/rspec/core/configuration_options.rb
|
@@ -275,6 +276,7 @@ files:
|
|
275
276
|
- spec/autotest/rspec_spec.rb
|
276
277
|
- spec/command_line/order_spec.rb
|
277
278
|
- spec/rspec/core/backtrace_cleaner_spec.rb
|
279
|
+
- spec/rspec/core/caller_filter_spec.rb
|
278
280
|
- spec/rspec/core/command_line_spec.rb
|
279
281
|
- spec/rspec/core/command_line_spec_output.txt
|
280
282
|
- spec/rspec/core/configuration_options_spec.rb
|
@@ -312,7 +314,6 @@ files:
|
|
312
314
|
- spec/rspec/core/formatters/text_mate_formatted-1.9.3-rbx.html
|
313
315
|
- spec/rspec/core/formatters/text_mate_formatted-1.9.3.html
|
314
316
|
- spec/rspec/core/formatters/text_mate_formatted-2.0.0.html
|
315
|
-
- spec/rspec/core/formatters/text_mate_formatted-2.1.0.html
|
316
317
|
- spec/rspec/core/formatters/text_mate_formatter_spec.rb
|
317
318
|
- spec/rspec/core/hooks_filtering_spec.rb
|
318
319
|
- spec/rspec/core/hooks_spec.rb
|
@@ -349,6 +350,7 @@ files:
|
|
349
350
|
- spec/support/mathn_integration_support.rb
|
350
351
|
- spec/support/sandboxed_mock_space.rb
|
351
352
|
- spec/support/shared_example_groups.rb
|
353
|
+
- spec/support/silence_dsl_deprecations.rb
|
352
354
|
- spec/support/spec_files.rb
|
353
355
|
- exe/autospec
|
354
356
|
- exe/rspec
|
@@ -368,15 +370,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
368
370
|
version: '0'
|
369
371
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
370
372
|
requirements:
|
371
|
-
- - ! '
|
373
|
+
- - ! '>'
|
372
374
|
- !ruby/object:Gem::Version
|
373
|
-
version:
|
375
|
+
version: 1.3.1
|
374
376
|
requirements: []
|
375
377
|
rubyforge_project: rspec
|
376
378
|
rubygems_version: 2.0.7
|
377
379
|
signing_key:
|
378
380
|
specification_version: 4
|
379
|
-
summary: rspec-core-2.
|
381
|
+
summary: rspec-core-2.99.0.beta1
|
380
382
|
test_files:
|
381
383
|
- features/Autotest.md
|
382
384
|
- features/README.md
|
@@ -449,6 +451,7 @@ test_files:
|
|
449
451
|
- spec/autotest/rspec_spec.rb
|
450
452
|
- spec/command_line/order_spec.rb
|
451
453
|
- spec/rspec/core/backtrace_cleaner_spec.rb
|
454
|
+
- spec/rspec/core/caller_filter_spec.rb
|
452
455
|
- spec/rspec/core/command_line_spec.rb
|
453
456
|
- spec/rspec/core/command_line_spec_output.txt
|
454
457
|
- spec/rspec/core/configuration_options_spec.rb
|
@@ -486,7 +489,6 @@ test_files:
|
|
486
489
|
- spec/rspec/core/formatters/text_mate_formatted-1.9.3-rbx.html
|
487
490
|
- spec/rspec/core/formatters/text_mate_formatted-1.9.3.html
|
488
491
|
- spec/rspec/core/formatters/text_mate_formatted-2.0.0.html
|
489
|
-
- spec/rspec/core/formatters/text_mate_formatted-2.1.0.html
|
490
492
|
- spec/rspec/core/formatters/text_mate_formatter_spec.rb
|
491
493
|
- spec/rspec/core/hooks_filtering_spec.rb
|
492
494
|
- spec/rspec/core/hooks_spec.rb
|
@@ -523,5 +525,6 @@ test_files:
|
|
523
525
|
- spec/support/mathn_integration_support.rb
|
524
526
|
- spec/support/sandboxed_mock_space.rb
|
525
527
|
- spec/support/shared_example_groups.rb
|
528
|
+
- spec/support/silence_dsl_deprecations.rb
|
526
529
|
- spec/support/spec_files.rb
|
527
530
|
has_rdoc:
|