Sha256: 5e73ddb6297dde74ad5dc7e39e2ee0b820349bdca4064a57a6b7acdce3e2d272

Contents?: true

Size: 830 Bytes

Versions: 7

Compression:

Stored size: 830 Bytes

Contents

require 'test/unit'
require 'rubygems'
require 'shoulda'
require 'mocha'
require 'fakeweb'

require File.join(File.dirname(__FILE__), '..', 'lib', 'eroi')

FakeWeb.allow_net_connect = false

def fixture_file(filename)
  return '' if filename == ''
  file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
  File.read(file_path)
end

def stub_get(url, filename, status=nil)
  options = { :body => fixture_file(filename) }
  options.merge!({ :status => status }) unless status.nil?
  
  FakeWeb.register_uri(:get, url, options)
end

def fixture(key)
  yaml_data = YAML.load(File.read(File.join(File.dirname(__FILE__), 'fixtures.yml')))
  symbolize_keys(yaml_data)
  yaml_data[key]
end

def symbolize_keys(hash)
  return unless hash.is_a?(Hash)
  hash.symbolize_keys!
  hash.each{|k,v| symbolize_keys(v)}
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eroi-0.2.1 test/test_helper.rb
eroi-0.2.0 test/test_helper.rb
eroi-0.1.4 test/test_helper.rb
eroi-0.1.3 test/test_helper.rb
eroi-0.1.2 test/test_helper.rb
eroi-0.1.1 test/test_helper.rb
eroi-0.1.0 test/test_helper.rb