Sha256: a8e853c11a2d1224892aebe3e2b4acbc8eddd60473c7ae22a45c85e8d8bc0d1c

Contents?: true

Size: 1.28 KB

Versions: 98

Compression:

Stored size: 1.28 KB

Contents

# require 'simplecov'
# SimpleCov.start do
#   add_filter "/test/"
#   use_merging true
# end

require 'mls'
require 'turn'
require 'faker'
require 'test/unit'
require 'factory_girl'
require 'fakeweb'

CACHE = {}
MLS_HOST = ENV['MLS_URL'] || 'http://localhost:4000/api'
FactoryGirl.find_definitions

MLS.url = ENV["MLS_TEST_URL"] || 'http://LBJXFC%2BhDiRRCYj6kXtXREfgNXRCJa8ALvPn%2FIeyjSe2QsQyHZ%2F%2BWwN2VZM2cw%3D%3D@localhost:4000'#
# MLS.auth_key = MLS::Account.authenticate('jonbracy@gmail.com', 'test').auth_key

# File 'lib/active_support/testing/declarative.rb', somewhere in rails....
class ::Test::Unit::TestCase
  def self.test(name, &block)
    test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
    defined = instance_method(test_name) rescue false
    raise "#{test_name} is already defined in #{self}" if defined
    if block_given?
      define_method(test_name, &block)
    else
      define_method(test_name) do
        flunk "No implementation provided for #{name}"
      end
    end
  end
end

def mock_response(method=:get, code='200', body='')
  FakeWeb.register_uri(method, "http://mls.test/test", :status => [code, "Filler"], :body => body)
  uri = URI.parse("http://mls.test/test")
  case method
  when :get
    Net::HTTP.get_response(uri)
  when :post
    Net::HTTP.post_form(uri)
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
mls-0.3.5 test/test_helper.rb
mls-0.3.4 test/test_helper.rb
mls-0.3.3 test/test_helper.rb
mls-0.3.2 test/test_helper.rb
mls-0.3.1 test/test_helper.rb
mls-0.3.0 test/test_helper.rb
mls-0.2.54 test/test_helper.rb
mls-0.2.53 test/test_helper.rb
mls-0.2.52 test/test_helper.rb
mls-0.2.51 test/test_helper.rb
mls-0.2.50 test/test_helper.rb
mls-0.2.49 test/test_helper.rb
mls-0.2.48 test/test_helper.rb
mls-0.2.47 test/test_helper.rb
mls-0.2.46 test/test_helper.rb
mls-0.2.45 test/test_helper.rb
mls-0.2.44 test/test_helper.rb
mls-0.2.43 test/test_helper.rb
mls-0.2.42 test/test_helper.rb
mls-0.2.41 test/test_helper.rb