This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,20 @@ class RakeTask < ::Rake::TaskLib
45
45
# A message to print to stderr when there are failures.
46
46
attr_accessor :failure_message
47
47
48
- # Run RSpec with a clean (empty) environment.
49
- attr_accessor :with_clean_environment
48
+ if RUBY_VERSION < "1.9.0" || Support ::Ruby . jruby?
49
+ # Run RSpec with a clean (empty) environment is not supported
50
+ def with_clean_environment = ( _value )
51
+ raise ArgumentError , "Running in a clean environment is not supported on Ruby versions before 1.9.0"
52
+ end
53
+
54
+ # Run RSpec with a clean (empty) environment is not supported
55
+ def with_clean_environment
56
+ false
57
+ end
58
+ else
59
+ # Run RSpec with a clean (empty) environment.
60
+ attr_accessor :with_clean_environment
61
+ end
50
62
51
63
# Use verbose output. If this is set to true, the task will print the
52
64
# executed spec command to stdout. Defaults to `true`.
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def silence_output(&block)
149
149
end
150
150
151
151
context "with_clean_environment is set" do
152
- it "removes the environment variables" do
152
+ it "removes the environment variables" , :if => ( RUBY_VERSION >= '1.9.0' || RSpec :: Support :: Ruby . jruby? ) do
153
153
with_env_vars 'MY_ENV' => 'ABC' do
154
154
expect {
155
155
task . with_clean_environment = true
You can’t perform that action at this time.
0 commit comments