Sha256: b0cf29f6f418f0f9f7bee2d115cf3e2800d9532218273d1b87907c44cadcd6b0

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'json'
require 'hashie'
require 'net/http'
require 'google_contacts_api'

puts "Testing version #{GoogleContactsApi::VERSION}"

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  config.mock_framework = :rspec
end

def contact_set_json
  f = File.open("#{File.dirname(__FILE__)}/contact_set.json")
  json = f.read
  f.close
  json
end

def group_set_json
  f = File.open("#{File.dirname(__FILE__)}/group_set.json")
  json = f.read
  f.close
  json
end

def contact_json_hash
  Hashie::Mash.new(JSON.parse(contact_set_json)).feed.entry.first
end

def contact_no_emails_json_hash
  Hashie::Mash.new(JSON.parse(contact_set_json)).feed.entry[1]
end

def contact_no_primary_email_json_hash
  Hashie::Mash.new(JSON.parse(contact_set_json)).feed.entry[2]
end

def group_json_hash
  Hashie::Mash.new(JSON.parse(group_set_json)).feed.entry.first
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google_contacts_api-0.2.7 spec/spec_helper.rb