Skip to content

Commit

Permalink
Add an easy way to print ExecResult in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
  • Loading branch information
Morriar committed Mar 4, 2022
1 parent 9ef7521 commit 09c2eaf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/helpers/mock_project.rb
Expand Up @@ -66,9 +66,22 @@ def reset_bundler_version
end

class ExecResult < T::Struct
extend T::Sig

const :out, String
const :err, String
const :status, T::Boolean

sig { returns(String) }
def to_s
<<~STR
########## STDOUT ##########
#{out.empty? ? "<empty>" : out}
########## STDERR ##########
#{err.empty? ? "<empty>" : err}
########## STATUS: #{status} ##########
STR
end
end

# Run `bundle install` in this project context (unbundled env)
Expand Down

0 comments on commit 09c2eaf

Please sign in to comment.