Sha256: ed8a50412da5bf59a94a0ddd89b58b48f8b2e08b6cc79020c7bab5e19ac0e97a

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'helper'

describe Twitter::Settings do

  describe "#trend_location" do
    it "returns a Twitter::Place when trend_location is set" do
      settings = Twitter::Settings.new(:trend_location => {:countryCode => "US", :name => "San Francisco", :country => "United States", :placeType => {:name => "Town", :code => 7}, :woeid => 2487956, :parentid => 23424977, :url => "http://where.yahooapis.com/v1/place/2487956"})
      expect(settings.trend_location).to be_a Twitter::Place
    end
    it "returns nil when trend_location is not set" do
      settings = Twitter::Settings.new
      expect(settings.trend_location).to be_nil
    end
  end

  describe "#trend_location?" do
    it "returns true when trend_location is set" do
      settings = Twitter::Settings.new(:trend_location => {:countryCode => "US", :name => "San Francisco", :country => "United States", :placeType => {:name => "Town", :code => 7}, :woeid => 2487956, :parentid => 23424977, :url => "http://where.yahooapis.com/v1/place/2487956"})
      expect(settings.trend_location?).to be_true
    end
    it "returns false when trend_location is not set" do
      settings = Twitter::Settings.new
      expect(settings.trend_location?).to be_false
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-5.0.0.rc.1 spec/twitter/settings_spec.rb