Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit aa07a94

Browse files
committed
fixup! Use isolated_home helper
1 parent 51b7b2f commit aa07a94

File tree

7 files changed

+38
-12
lines changed

7 files changed

+38
-12
lines changed

.rspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
--order rand
22
--warnings
33
--require spec_helper
4-
--no-profile

spec/integration/spec_file_load_errors_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@
8383
EOS
8484
end
8585

86-
it 'nicely handles load-time errors in user spec files' do
87-
write_file ".rspec", "--no-profile"
86+
it 'nicely handles load-time errors in user spec files', isolated_home: true do
8887
write_file_formatted "1_spec.rb", "
8988
boom
9089

spec/integration/suite_hooks_errors_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
end
3333

3434
def run_spec_expecting_non_zero(before_or_after)
35-
write_file ".rspec", "--no-profile"
3635
write_file "the_spec.rb", "
3736
RSpec.configure do |c|
3837
c.#{before_or_after}(:suite) do
@@ -50,7 +49,7 @@ def run_spec_expecting_non_zero(before_or_after)
5049
normalize_durations(last_cmd_stdout)
5150
end
5251

53-
it 'nicely formats errors in `before(:suite)` hooks and exits with non-zero' do
52+
it 'nicely formats errors in `before(:suite)` hooks and exits with non-zero', isolated_home: true do
5453
output = run_spec_expecting_non_zero(:before)
5554
expect(output).to eq unindent(<<-EOS)
5655
@@ -68,7 +67,7 @@ def run_spec_expecting_non_zero(before_or_after)
6867
EOS
6968
end
7069

71-
it 'nicely formats errors in `after(:suite)` hooks and exits with non-zero' do
70+
it 'nicely formats errors in `after(:suite)` hooks and exits with non-zero', isolated_home: true do
7271
output = run_spec_expecting_non_zero(:after)
7372
expect(output).to eq unindent(<<-EOS)
7473
.
@@ -86,8 +85,7 @@ def run_spec_expecting_non_zero(before_or_after)
8685
EOS
8786
end
8887

89-
it 'nicely formats errors from multiple :suite hooks of both types and exits with non-zero' do
90-
write_file ".rspec", "--no-profile"
88+
it 'nicely formats errors from multiple :suite hooks of both types and exits with non-zero', isolated_home: true do
9189
write_file "the_spec.rb", "
9290
RSpec.configure do |c|
9391
c.before(:suite) { raise 'before 1' }

spec/rspec/core/formatters/documentation_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def execution_result(values)
100100
end
101101

102102
# The backtrace is slightly different on JRuby/Rubinius so we skip there.
103-
it 'produces the expected full output', :if => RSpec::Support::Ruby.mri? do
103+
it 'produces the expected full output', isolated_home: true, :if => RSpec::Support::Ruby.mri? do
104104
output = run_example_specs_with_formatter("doc")
105105
output.gsub!(/ +$/, '') # strip trailing whitespace
106106

spec/rspec/core/formatters/html_formatter_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def extract_backtrace_from(doc)
5757
end
5858
end
5959

60-
describe 'produced HTML', :slow, :if => RUBY_VERSION >= '2.0.0' do
61-
it "is identical to the one we designed manually", :pending => (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') do
60+
describe 'produced HTML', :slow, isolated_home: true, :if => RUBY_VERSION >= '2.0.0' do
61+
it 'is identical to the one we designed manually', :pending => (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') do
6262
expect(actual_html).to eq(expected_html)
6363
end
6464

spec/rspec/core/formatters/progress_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
end
4141

4242
# The backtrace is slightly different on JRuby/Rubinius so we skip there.
43-
it 'produces the expected full output', :if => RSpec::Support::Ruby.mri? do
43+
it 'produces the expected full output', isolated_home: true, :if => RSpec::Support::Ruby.mri? do
4444
output = run_example_specs_with_formatter("progress")
4545
output.gsub!(/ +$/, '') # strip trailing whitespace
4646

spec/support/formatter_support.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def expected_summary_output_for_example_specs
6969
| # ./spec/rspec/core/resources/formatter_specs.rb:18
7070
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
7171
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
72+
| # ./spec/support/isolated_home_directory.rb:13:in `block (5 levels) in <top (required)>'
73+
| # ./spec/spec_helper.rb:46:in `with_env_vars'
74+
| # ./spec/support/isolated_home_directory.rb:12:in `block (4 levels) in <top (required)>'
75+
| # ./spec/spec_helper.rb:57:in `without_env_vars'
76+
| # ./spec/support/isolated_home_directory.rb:11:in `block (3 levels) in <top (required)>'
77+
| # ./spec/support/isolated_home_directory.rb:7:in `block (2 levels) in <top (required)>'
7278
| # ./spec/support/sandboxing.rb:16
7379
| # ./spec/support/sandboxing.rb:7
7480
|
@@ -89,6 +95,12 @@ def expected_summary_output_for_example_specs
8995
| # ./spec/rspec/core/resources/formatter_specs.rb:37
9096
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
9197
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
98+
| # ./spec/support/isolated_home_directory.rb:13:in `block (5 levels) in <top (required)>'
99+
| # ./spec/spec_helper.rb:46:in `with_env_vars'
100+
| # ./spec/support/isolated_home_directory.rb:12:in `block (4 levels) in <top (required)>'
101+
| # ./spec/spec_helper.rb:57:in `without_env_vars'
102+
| # ./spec/support/isolated_home_directory.rb:11:in `block (3 levels) in <top (required)>'
103+
| # ./spec/support/isolated_home_directory.rb:7:in `block (2 levels) in <top (required)>'
92104
| # ./spec/support/sandboxing.rb:16
93105
| # ./spec/support/sandboxing.rb:7
94106
|
@@ -164,6 +176,12 @@ def expected_summary_output_for_example_specs
164176
| # ./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
165177
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
166178
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
179+
| # ./spec/support/isolated_home_directory.rb:13:in `block (5 levels) in <top (required)>'
180+
| # ./spec/spec_helper.rb:46:in `with_env_vars'
181+
| # ./spec/support/isolated_home_directory.rb:12:in `block (4 levels) in <top (required)>'
182+
| # ./spec/spec_helper.rb:57:in `without_env_vars'
183+
| # ./spec/support/isolated_home_directory.rb:11:in `block (3 levels) in <top (required)>'
184+
| # ./spec/support/isolated_home_directory.rb:7:in `block (2 levels) in <top (required)>'
167185
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
168186
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
169187
|
@@ -184,6 +202,12 @@ def expected_summary_output_for_example_specs
184202
| # ./spec/rspec/core/resources/formatter_specs.rb:37:in `block (2 levels) in <top (required)>'
185203
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
186204
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
205+
| # ./spec/support/isolated_home_directory.rb:13:in `block (5 levels) in <top (required)>'
206+
| # ./spec/spec_helper.rb:46:in `with_env_vars'
207+
| # ./spec/support/isolated_home_directory.rb:12:in `block (4 levels) in <top (required)>'
208+
| # ./spec/spec_helper.rb:57:in `without_env_vars'
209+
| # ./spec/support/isolated_home_directory.rb:11:in `block (3 levels) in <top (required)>'
210+
| # ./spec/support/isolated_home_directory.rb:7:in `block (2 levels) in <top (required)>'
187211
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
188212
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
189213
|
@@ -215,6 +239,12 @@ def expected_summary_output_for_example_specs
215239
| # ./spec/rspec/core/resources/formatter_specs.rb:50:in `block (2 levels) in <top (required)>'
216240
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
217241
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
242+
| # ./spec/support/isolated_home_directory.rb:13:in `block (5 levels) in <top (required)>'
243+
| # ./spec/spec_helper.rb:46:in `with_env_vars'
244+
| # ./spec/support/isolated_home_directory.rb:12:in `block (4 levels) in <top (required)>'
245+
| # ./spec/spec_helper.rb:57:in `without_env_vars'
246+
| # ./spec/support/isolated_home_directory.rb:11:in `block (3 levels) in <top (required)>'
247+
| # ./spec/support/isolated_home_directory.rb:7:in `block (2 levels) in <top (required)>'
218248
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
219249
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
220250
|

0 commit comments

Comments
 (0)