feat(test): Tests for custom install dir

ref: issue #34
This commit is contained in:
Raphael Reitzig 2022-03-08 23:12:29 +01:00
parent 7c0ece3dfb
commit 4c15f15ced
8 changed files with 135 additions and 10 deletions

View file

@ -17,11 +17,30 @@ When('we run fish script') do |script_content|
raise "Fish command failed: #{out}"
end
@response_fish_script = out.strip
@output_fish_script = out.strip
end
Then(/^the output is$/) do |text|
expect(@response_fish_script).to eq(text.strip)
expect(@output_fish_script).to eq(text.strip)
end
When('we run {string} in Fish') do |command|
@response = run_fish_command(command)
end
Then('the exit code is {int}') do |code|
expect(@response[:status]).to eq(code)
end
Then(/^environment variable ([A-Z_]+) has value "([^"]+)"$/) do |key, value|
expect(@response[:env][key]).to eq(value)
end
And('the output contains {string}') do |content|
output = @response[:stdout]
.select { |line| !line.blank? }
.map { |line| line.strip }
expect(output).to include(content)
end
Then(/^file ([a-zA-Z0-9\-_.\/]+) contains$/) do |file,content|