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

Commit 41a6129

Browse files
committed
fixup! Add step to remove XDG_CONFIG_HOME env var
1 parent aa07a94 commit 41a6129

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

features/command_line/init.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Feature: `--init` option
2525
Scenario: Accept and use the recommended settings in `spec_helper` (which are initially commented out)
2626
Given I have a brand new project with no files
2727
And I have run `rspec --init`
28+
And I unset XDG_CONFIG_HOME environment var
2829
When I accept the recommended settings by removing `=begin` and `=end` from `spec/spec_helper.rb`
2930
And I create "spec/addition_spec.rb" with the following content:
3031
"""ruby

features/command_line/warnings_option.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ Feature: `--warnings` option (run with warnings enabled)
2525
end
2626
end
2727
"""
28+
And I unset XDG_CONFIG_HOME environment var
2829
When I run `rspec example_spec.rb`
2930
Then the output should not contain "warning"

features/configuration/profile.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Feature: Profile examples
7373
"""
7474

7575
Scenario: By default does not show profile
76+
Given I unset XDG_CONFIG_HOME environment var
7677
When I run `rspec spec`
7778
Then the examples should all pass
7879
And the output should not contain "example 1"
@@ -92,6 +93,7 @@ Feature: Profile examples
9293
"""ruby
9394
RSpec.configure { |c| c.profile_examples = true }
9495
"""
96+
And I unset XDG_CONFIG_HOME environment var
9597
When I run `rspec spec`
9698
Then the examples should all pass
9799
And the output should contain "Top 10 slowest examples"

features/formatters/configurable_colors.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ Feature: Configurable colors
2727
end
2828
end
2929
"""
30-
When I run `rspec custom_failure_color_spec.rb --format progress`
31-
Then the failing example is printed in magenta
30+
And I unset XDG_CONFIG_HOME environment var
31+
When I run `rspec custom_failure_color_spec.rb --format progress`
32+
Then the failing example is printed in magenta

features/step_definitions/additional_cli_steps.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@
238238
end
239239
end
240240

241+
Given(/^I unset XDG_CONFIG_HOME environment var$/) do
242+
step %q{I set the environment variables to:}, table(%{
243+
| variable | value |
244+
| XDG_CONFIG_HOME | |
245+
})
246+
end
247+
241248
module Normalization
242249
def normalize_failure_output(text)
243250
whitespace_normalized = text.lines.map { |line| line.sub(/\s+$/, '').sub(/:in .*$/, '') }.join

features/support/env.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
end
1212
end
1313

14-
Aruba.configure do |config|
15-
config.before_cmd do |cmd|
16-
set_env('XDG_CONFIG_HOME', 'nonexistent-directory') # skip loading global configuration
17-
end
18-
end
19-
2014
Aruba.configure do |config|
2115
config.before_cmd do |cmd|
2216
set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived

0 commit comments

Comments
 (0)