Sha256: 52c584b8e9d17d1682b05fd723c96bc029769606a38be4ca8cd3a3e9403cf8b1

Contents?: true

Size: 746 Bytes

Versions: 3

Compression:

Stored size: 746 Bytes

Contents

require 'minitest/autorun'
require 'rubygems'
require 'shoulda'
require 'flexmock/minitest'
require 'fakeweb'

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

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 api_key
  'test_key'
end
def login
  'test_account'
end
def access_token
  'test_access_token'
end

class Minitest::Test
  def teardown
    FakeWeb.clean_registry
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bitly-1.0.2 test/test_helper.rb
bitly-1.0.1 test/test_helper.rb
bitly-1.0.0 test/test_helper.rb