Skip to content

Commit cf0dbcd

Browse files
committed
Ensure that lib installation during tests only happens in pristine dir
1 parent afce5ef commit cf0dbcd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/cpp_library_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def verified_install(backend, path)
8282
fld = FakeLibDir.new
8383
backend = fld.backend
8484
cpp_lib_path = sampleproj_path + "DoSomething"
85-
cpp_library = verified_install(backend, cpp_lib_path)
85+
86+
around(:example) { |example| fld.in_pristine_fake_libraries_dir(example) }
87+
before(:each) { @cpp_library = verified_install(backend, cpp_lib_path) }
8688

8789
# the keys are the methods of cpp_library to call
8890
# the results are what we expect to see based on the config we loaded
@@ -95,7 +97,7 @@ def verified_install(backend, path)
9597

9698
methods_and_results.each do |m, expected|
9799
it "Creates #{m} from config" do
98-
expect(expected).to eq(cpp_library.send(m, bogo_config))
100+
expect(expected).to eq(@cpp_library.send(m, bogo_config))
99101
end
100102
end
101103

0 commit comments

Comments
 (0)