Sha256: 13b557f9ea496384975401a5a801806a94c2fca4af988a09565c82d59558c3bd

Contents?: true

Size: 824 Bytes

Versions: 5

Compression:

Stored size: 824 Bytes

Contents

gem 'minitest'
require 'minitest/autorun'

require 'fakeweb'

require File.expand_path('../lib/ing', File.dirname(__FILE__))

ARGV.clear

# Load fixtures
load File.join(File.dirname(__FILE__), "fixtures", "task.ing.rb")
load File.join(File.dirname(__FILE__), "fixtures", "group.ing.rb")
load File.join(File.dirname(__FILE__), "fixtures", "invok.ing.rb")

module TestHelpers

  def source_root
    File.join(File.dirname(__FILE__), 'fixtures')
  end

  def destination_root
    File.join(File.dirname(__FILE__), 'sandbox')
  end

  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end
  alias :silence :capture
  
end

SpecHelpers = TestHelpers

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ing-0.2.2 test/test_helper.rb
ing-0.2.1 test/test_helper.rb
ing-0.1.5 test/test_helper.rb
ing-0.1.2 test/test_helper.rb
ing-0.1.1 test/test_helper.rb