Sha256: 63bdcb0708ca8de3c5424083b4df8e424ff604b644b0025ba0120f96ebaf10b3
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe 'TweetStream JSON Parsers' do it 'should default to the JSON Gem' do TweetStream::Client.new('abc','def','hij','klm').parser.should == TweetStream::Parsers::JsonGem end [:json_gem, :yajl, :active_support, :json_pure].each do |engine| describe "#{engine} parsing" do before do @client = TweetStream::Client.new('abc','def','hij','klm',engine) @class_name = "TweetStream::Parsers::#{engine.to_s.split('_').map{|s| s.capitalize}.join('')}" end it 'should set the parser to the appropriate class' do @client.parser.to_s == @class_name end it 'should be settable via client.parser=' do @client.parser = nil @client.parser.should be_nil @client.parser = engine @client.parser.to_s.should == @class_name end end end class FakeParser def self.decode(text) {} end end it 'should be settable to a class' do @client = TweetStream::Client.new('abc','def','hij','klm') @client.parser = FakeParser @client.parser.should == FakeParser end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xh5-tweetstream-1.1.0 | spec/tweetstream/parser_spec.rb |