Sha256: 03caa744634c9a2d0c363c542b5003f66ac05d650939e93982bcbc9e422626ed

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

require "rspec"
require "clamp"
require 'stringio'

RSpec.configure do |config|

  config.mock_with :rr

end

module OutputCapture

  def self.included(target)

    target.before do
      $stdout = @out = StringIO.new
      $stderr = @err = StringIO.new
    end

    target.after do
      $stdout = STDOUT
      $stderr = STDERR
    end

  end

  def stdout
    @out.string
  end

  def stderr
    @err.string
  end

end

module CommandFactory

  def given_command(name, &block)
    let(:command) do
      Class.new(Clamp::Command, &block).new(name)
    end
  end

end

module SetEnv

  def set_env(name, value)
    if value
      ENV[name] = value
    else
      ENV.delete(name)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clamp-0.6.4 spec/spec_helper.rb