Sha256: 3574a9fd6fc94c8bbda68a80f076244d5a18e9c6fc49e923c8ace337454881d9

Contents?: true

Size: 1.07 KB

Versions: 27

Compression:

Stored size: 1.07 KB

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

require 'spec_helper'

describe TwitterCldr::Shared::Territory do
  let(:code) { '013' }
  let(:territory) { described_class.new(code) }
  let(:containment) { TwitterCldr::Shared::TerritoriesContainment }

  describe '#parents' do
    let(:parents) { %w[013 territory parents] }

    it 'delegates to TerritoriesContainment.parents' do
      expect(containment).to receive(:parents).with(code).and_return(parents)
      expect(territory.parents).to eq(parents)
    end
  end

  describe '#children' do
    let(:children) { %w[013 territory children] }

    it 'delegates to TerritoriesContainment.children' do
      expect(containment).to receive(:children).with(code).and_return(children)
      expect(territory.children).to eq(children)
    end
  end

  describe '#contains?' do
    let(:other_code) { 'RU' }

    it 'delegates to TerritoriesContainment.contains?' do
      expect(containment).to receive(:contains?).with(code, other_code)
      territory.contains?(other_code)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
twitter_cldr-6.12.0 spec/shared/territory_spec.rb
twitter_cldr-6.11.5 spec/shared/territory_spec.rb
twitter_cldr-6.11.4 spec/shared/territory_spec.rb
twitter_cldr-6.11.3 spec/shared/territory_spec.rb
twitter_cldr-6.11.2 spec/shared/territory_spec.rb
twitter_cldr-6.11.1 spec/shared/territory_spec.rb
twitter_cldr-6.11.0 spec/shared/territory_spec.rb
twitter_cldr-6.10.0 spec/shared/territory_spec.rb
twitter_cldr-6.9.0 spec/shared/territory_spec.rb
twitter_cldr-6.8.0 spec/shared/territory_spec.rb
twitter_cldr-6.7.0 spec/shared/territory_spec.rb
twitter_cldr-6.6.2 spec/shared/territory_spec.rb
twitter_cldr-6.6.1 spec/shared/territory_spec.rb
twitter_cldr-6.6.0 spec/shared/territory_spec.rb
twitter_cldr-6.5.0 spec/shared/territory_spec.rb
twitter_cldr-6.4.0 spec/shared/territory_spec.rb
twitter_cldr-6.3.0 spec/shared/territory_spec.rb
twitter_cldr-6.2.0 spec/shared/territory_spec.rb
twitter_cldr-6.1.0 spec/shared/territory_spec.rb
twitter_cldr-6.0.2 spec/shared/territory_spec.rb