Sha256: de081715d71d00eeeb951ba6b499f903340cabfeee6227d8bcddbc0b7be22f9e

Contents?: true

Size: 845 Bytes

Versions: 2

Compression:

Stored size: 845 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 samples(fixture)
  samples = []
  Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash|
    samples << hash
  end
  samples
end

def sample_tweets
  return @tweets if @tweets
  @tweets = samples('statuses.json')
end

def sample_direct_messages
  return @direct_messages if @direct_messages
  @direct_messages = samples('direct_messages.json')
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.3.0 spec/spec_helper.rb
tweetstream-2.2.0 spec/spec_helper.rb