mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-26 05:37:11 -07:00
parent
7c0ece3dfb
commit
4c15f15ced
8 changed files with 135 additions and 10 deletions
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue