spec/twitter/settings_spec.rb in twitter-4.8.1 vs spec/twitter/settings_spec.rb in twitter-5.0.0.rc.1

- old
+ new

@@ -1,16 +1,27 @@ require 'helper' describe Twitter::Settings do describe "#trend_location" do - it "returns a Twitter::Place when set" do - place = 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(place.trend_location).to be_a Twitter::Place + 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 not set" do - place = Twitter::Settings.new - expect(place.trend_location).to be_nil + 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