Skip to content

Commit

Permalink
Set up Aruba environment properly in 'uses aruba API' shared context
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Dec 25, 2022
1 parent f6a32dc commit d2045b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/support/shared_contexts/aruba.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def create_test_files(files, data = "a")
end
end

before do
around do |example|
klass = Class.new do
include Aruba::Api

Expand All @@ -36,5 +36,12 @@ def set_tag(tag_name, value)
if @aruba.aruba.current_directory[0] == "/"
raise "We must work with relative paths, everything else is dangerous"
end

# Use configured home directory as HOME
@aruba.set_environment_variable "HOME", aruba.config.home_directory

@aruba.with_environment do
example.run
end
end
end

0 comments on commit d2045b8

Please sign in to comment.