Sha256: 1d66873a66b27e5c255615064b50dc53cf41a88c1e9e0929329fb138e21d16c6

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
# require_relative "../config/environment.rb"

RSpec.configure do |config|
  config.order = :default
end

RSpec::Matchers.define :include_array do |expected|
  match do |actual|
    actual.any?{|array| match_array(expected).matches?(array)}
  end
end

def run_file(file)
  eval(File.read(file), binding)
end

def get_variable_from_file(file, variable)
  file_scope = binding
  file_scope.eval(File.read(file))

  begin
    return file_scope.local_variable_get(variable)
  rescue NameError
    raise NameError, "local variable `#{variable}' not defined in #{file}."
  end
end

def capture_puts
  begin
    old_stdout = $stdout
    $stdout = StringIO.new('','w')
    yield
    $stdout.string
  ensure
    $stdout = old_stdout
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tictactoe_tracypholmes-0.1.3 spec/spec_helper.rb