Sha256: 0f6cd662bdd184b7cbedbb17881dcf0399c8843710391183d8ac33e9da05643e

Contents?: true

Size: 957 Bytes

Versions: 2

Compression:

Stored size: 957 Bytes

Contents

unless ENV['CI']
  require 'simplecov'
  SimpleCov.start do
    add_group 'Tweetstream', 'lib/tweetstream'
    add_group 'Specs', 'spec'
  end
end

require 'tweetstream'
require 'tweetstream/site_stream_client'
require 'rspec'
require 'webmock/rspec'
require 'yajl'
require 'json'

def sample_tweets
  return @tweets if @tweets

  @tweets = []
  Yajl::Parser.parse(File.open(File.dirname(__FILE__) + '/data/statuses.json', 'r'), :symbolize_keys => true) do |hash|
    @tweets << hash
  end
  @tweets
end

def sample_direct_messages
  return @direct_messages if @direct_messages

  @direct_messages = []
  Yajl::Parser.parse(File.open(File.dirname(__FILE__) + '/data/direct_messages.json', 'r')) do |hash|
    @direct_messages << hash
  end
  @direct_messages
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

def fixture(file)
  File.new(fixture_path + '/' + file)
end

FakeHttp = Class.new do
  def callback; end
  def errback; end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tweetstream-2.0.1 spec/spec_helper.rb
tweetstream-2.0.0 spec/spec_helper.rb