Sha256: 208277c2d0fa38f4b051396a7069bbffed6afd358971b25d6ef666708887a848

Contents?: true

Size: 569 Bytes

Versions: 5

Compression:

Stored size: 569 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
clamp-0.6.3 spec/spec_helper.rb
clamp-0.6.2 spec/spec_helper.rb
clamp-0.6.1 spec/spec_helper.rb
clamp-0.6.0 spec/spec_helper.rb
clamp-0.5.1 spec/spec_helper.rb