Sha256: b3e138ab7ac4ba805fbb31daaf2f69522baf0f9f503397beab811c4474fc79bd

Contents?: true

Size: 852 Bytes

Versions: 9

Compression:

Stored size: 852 Bytes

Contents

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

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

require 'textmagic'

class Test::Unit::TestCase
end

def random_string(legth = 5)
  Array.new(legth) { rand(36).to_s(36) }.join
end

def random_phone
  rand(10 ** 12).to_s
end

def random_hash
  hash = {}
  3.times { hash[random_string] = random_string }
  hash
end

def build_uri(command, username, password, options = {})
  options.merge!(:cmd => command, :username => username, :password => password)
  uri = "http://www.textmagic.com/app/api?"
  uri << options.collect { |key, value| "#{key}=#{value}"}.join('&')
end

def load_response(filename)
  File.read(File.join(File.dirname(__FILE__), 'fixtures', filename) + '.json')
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
bobes-textmagic-0.2.0 test/test_helper.rb
bobes-textmagic-0.2.1 test/test_helper.rb
bobes-textmagic-0.2.2 test/test_helper.rb
bobes-textmagic-0.2.3 test/test_helper.rb
bobes-textmagic-0.3.0 test/test_helper.rb
textmagic-0.2.1 test/test_helper.rb
textmagic-0.2.2 test/test_helper.rb
textmagic-0.3.0 test/test_helper.rb
textmagic-0.2.0 test/test_helper.rb