File: settings_spec.rb

package info (click to toggle)
ruby-twitter 7.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,840 kB
  • sloc: ruby: 10,919; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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: 2_487_956, parentid: 23_424_977, 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: 2_487_956, parentid: 23_424_977, 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