Sha256: 1ef3a941f00932ccfb0a028294be528e71931caa11e870ef32ce9dd8f60d837b

Contents?: true

Size: 866 Bytes

Versions: 5

Compression:

Stored size: 866 Bytes

Contents

SPEC_FOLDER = File.dirname(__FILE__)
require 'yogi_berra'
require 'rspec/mocks'
# Helper methods
# Creates RunTimeError
def build_exception
  raise Exception
rescue Exception => caught_exception
  caught_exception
end

def build_session
  { "access" =>
    { "user_id" => 30785,
      "id" => 605,
      "password" => "[FILTERED]",
      "auth_key" => "Baseball is ninety percent mental and the other half is physical."
    }
  }
end

def mock_mongo_client(client_should = false, connection_should = false)
  mongo_client = double('mongo client')
  mongo_connection = double('mongo connection')
  Mongo::MongoClient.should_receive(:new) { mongo_client }
  mongo_client.should_receive(:[]) { mongo_connection } if client_should
  if connection_should
    mongo_connection.should_receive(:[]) { mongo_connection }
    mongo_connection.should_receive(:insert)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yogi_berra-0.0.10 spec/spec_helper.rb
yogi_berra-0.0.9 spec/spec_helper.rb
yogi_berra-0.0.8 spec/spec_helper.rb
yogi_berra-0.0.6 spec/spec_helper.rb
yogi_berra-0.0.5 spec/spec_helper.rb