Sha256: 24aed1aaa54ddd590c530e29acfd4ab0991ba93f125507897891ac0b3ca7206d

Contents?: true

Size: 1.02 KB

Versions: 22

Compression:

Stored size: 1.02 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'debugger'
require File.join(File.dirname(__FILE__), '../lib', 'pullentity-client')
#require 'lib/pullentity-client'
require 'stringio'
#require 'config'

ENV["pullentity_rspec"] = "test"

RSpec.configure do |config|

  def capture_with_status(stream)
    exit_status = 0
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      begin
        yield
      rescue SystemExit => system_exit # catch any exit calls
        exit_status = system_exit.status
      end
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end
    return result, exit_status
  end

  def remove_directories(*names)
    project_dir = Pathname.new(Dir.pwd)
    names.each do |name|
      FileUtils.rm_rf(project_dir.join(name)) if FileTest.exists?(project_dir.join(name))
    end
  end

  def fixture_file(type, filename)
    dir_name = type.to_s + "s"
    File.dirname(__FILE__) + "/fixtures/#{dir_name}/#{filename}"
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pullentity-client-0.3.9 spec/spec_helper.rb
pullentity-client-0.3.8 spec/spec_helper.rb
pullentity-client-0.3.7 spec/spec_helper.rb
pullentity-client-0.3.6 spec/spec_helper.rb
pullentity-client-0.3.5 spec/spec_helper.rb
pullentity-client-0.3.4 spec/spec_helper.rb
pullentity-client-0.3.3 spec/spec_helper.rb
pullentity-client-0.3.2 spec/spec_helper.rb
pullentity-client-0.3.1 spec/spec_helper.rb
pullentity-client-0.3.0 spec/spec_helper.rb
pullentity-client-0.1.3 spec/spec_helper.rb
pullentity-client-0.1.2 spec/spec_helper.rb
pullentity-client-0.1.1 spec/spec_helper.rb
pullentity-client-0.1.0 spec/spec_helper.rb
pullentity-client-0.0.9 spec/spec_helper.rb
pullentity-client-0.0.8 spec/spec_helper.rb
pullentity-client-0.0.7 spec/spec_helper.rb
pullentity-client-0.0.6 spec/spec_helper.rb
pullentity-client-0.0.4 spec/spec_helper.rb
pullentity-client-0.0.3 spec/spec_helper.rb