File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
before { FileUtils . mkdir_p tmp_root }
9
9
10
+ def bundler_env
11
+ if Bundler . respond_to? ( :with_unbundled_env )
12
+ Bundler . with_unbundled_env { yield }
13
+ else
14
+ Bundler . with_clean_env { yield }
15
+ end
16
+ end
17
+
10
18
it "fails when libraries are not required" do
11
19
script = tmp_root . join ( "fail_sanity_check" )
12
20
File . open ( script , "w" ) do |f |
17
25
end
18
26
FileUtils . chmod 0777 , script
19
27
20
- Bundler . with_clean_env do
28
+ bundler_env do
21
29
expect ( `bundle exec #{ script } 2>&1` ) .
22
30
to match ( /uninitialized constant RSpec::Support/ ) .
23
31
or match ( /undefined method `require_rspec_core' for RSpec::Support:Module/ )
38
46
end
39
47
FileUtils . chmod 0777 , script
40
48
41
- Bundler . with_clean_env do
49
+ bundler_env do
42
50
expect ( `bundle exec #{ script } 2>&1` ) . to be_empty
43
51
expect ( $?. exitstatus ) . to eq ( 0 )
44
52
end
You can’t perform that action at this time.
0 commit comments