Sha256: 9b5708933f739062ea3813e1f90ad81c647104b98b7b2cdf9a7b6388ca04e54a

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rspec'
require 'json'

if ENV['SIMPLE_COV']
  # SimpleCov
  # https://github.com/colszowka/simplecov
  require 'simplecov'
  SimpleCov.start do
    add_filter 'spec/'
    add_filter 'pkg/'
    add_filter 'vendor/'
  end
end

# XXX skip coverage setting if run appveyor. Because, fail to push coveralls in appveyor.
unless ENV['APPVEYOR']
  require 'coveralls'
  Coveralls.wear!('rails')
end

require 'td/command/runner'

def execute_td(command_line)
  args = command_line.split(" ")
  original_stdin, original_stderr, original_stdout = $stdin, $stderr, $stdout

  $stdin  = captured_stdin  = StringIO.new
  $stderr = captured_stderr = StringIO.new
  $stdout = captured_stdout = StringIO.new
  class << captured_stdout
    def tty?
      true
    end
  end

  begin
    runner = TreasureData::Command::Runner.new
    $0 = 'td'
    runner.run(args)
  rescue SystemExit
  ensure
    $stdin, $stderr, $stdout = original_stdin, original_stderr, original_stdout
  end

  [captured_stderr.string, captured_stdout.string]
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
td-0.11.13 spec/spec_helper.rb
td-0.11.12 spec/spec_helper.rb
td-0.11.11.2 spec/spec_helper.rb
td-0.11.11.1 spec/spec_helper.rb
td-0.11.11 spec/spec_helper.rb