Sha256: 8e2fd82a8ab26e7435db5971fec5de88a6c00871c1abad8dc323483e80543d29

Contents?: true

Size: 1.21 KB

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
twitter-5.1.1 spec/twitter/settings_spec.rb
twitter-5.1.0 spec/twitter/settings_spec.rb
twitter-5.0.1 spec/twitter/settings_spec.rb
twitter-5.0.0 spec/twitter/settings_spec.rb