Sha256: 4b4106f9affe92e62e18851ade506b436a0c4e795e03699bec753088f25b3fd8

Contents?: true

Size: 877 Bytes

Versions: 12

Compression:

Stored size: 877 Bytes

Contents

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

FakeWeb.allow_net_connect = false

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'twitterland'

class Test::Unit::TestCase
end

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

def twitter_url(url)
  url =~ /^http/ ? url : "http://twitter.com:80#{url}"
end

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

def stub_post(url, filename)
  FakeWeb.register_uri(:post, twitter_url(url), :body => fixture_file(filename))
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
squeejee-twitterland-0.0.1 test/test_helper.rb
squeejee-twitterland-0.0.2 test/test_helper.rb
squeejee-twitterland-0.1.1 test/test_helper.rb
squeejee-twitterland-0.2.0 test/test_helper.rb
squeejee-twitterland-0.2.1 test/test_helper.rb
twitterland-0.1.0 test/test_helper.rb
twitterland-0.1.1 test/test_helper.rb
twitterland-0.2.0 test/test_helper.rb
twitterland-0.2.1 test/test_helper.rb
twitterland-0.0.1 test/test_helper.rb
twitterland-0.0.2 test/test_helper.rb
twitterland-0.0.3 test/test_helper.rb