sdkman-for-fish/test/features/support/hooks.rb
Raphael Reitzig 5c886dcd1c feat(ci): Prevent test runs outside of container
It's not safe, we write and delete files all over the place!
2024-04-03 23:56:16 +02:00

23 lines
551 B
Ruby

require_relative '../step_definitions/setup'
require_relative '../step_definitions/corner_cases.rb'
BeforeAll do
if ENV.fetch('RUNNING_IN_CONTAINER', false) != 'yessir'
Kernel.abort("We don't seem to be running in a container; aborting for safety!")
end
run_bash_command('sdk update')
end
After do |scenario|
_remove_fish_configs
_restore_fish_config
_restore_config
_restore_install
end
AfterAll do
Dir["#{ENV['HOME']}/.sdkman/candidates/*/*"].each do |candidate_dir|
_uninstall_candidate_version(candidate_dir)
end
end