Skip to content

Commit

Permalink
Merge pull request #841 from Shopify/at-puts-result
Browse files Browse the repository at this point in the history
Add an easy way to print `ExecResult` in tests
  • Loading branch information
Morriar committed Mar 4, 2022
2 parents e990dd6 + 09c2eaf commit 76dd2ee
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 76dd2ee

Please sign in to comment.