Sha256: fb39f6b533a0c45c21fc2cb1def92a1e8f3e27c6923cf3d32bee94b903a3c8e4
Contents?: true
Size: 723 Bytes
Versions: 2
Compression:
Stored size: 723 Bytes
Contents
# encoding: UTF-8 require 'gooddata/cli/cli' module GoodData::Helpers module CliHelper # Execute block and capture its stdou # @param block Block to be executed with stdout redirected # @returns Captured output as string def capture_stdout(&block) original_stdout = $stdout $stdout = fake = StringIO.new begin yield ensure $stdout = original_stdout end fake.string end # Run CLI with arguments and return captured stdout # @param args Arguments # @return Captured stdout def run_cli(args = []) old = $0 $0 = 'gooddata' res = capture_stdout { GoodData::CLI.main(args) } $0 = old res end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gooddata-0.6.20 | spec/helpers/cli_helper.rb |
gooddata-0.6.19 | spec/helpers/cli_helper.rb |