Sha256: 6f60f14f3b0e87ceaef091acb88d71828cb483baa782616e6553e561e92cc2a8

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

# encoding: UTF-8

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

require 'spec_helper'

include TwitterCldr::Shared

describe Territory do
  let(:code) { '013' }
  let(:territory) { Territory.new(code) }

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

    it 'delegates to TerritoriesContainment.parents' do
      mock(TerritoriesContainment).parents(code) { parents }
      expect(territory.parents).to eq(parents)
    end
  end

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

    it 'delegates to TerritoriesContainment.children' do
      mock(TerritoriesContainment).children(code) { children }
      expect(territory.children).to eq(children)
    end
  end

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

    it 'delegates to TerritoriesContainment.contains?' do
      mock(TerritoriesContainment).contains?(code, other_code) { result }
      expect(territory.contains?(other_code)).to be_true
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
twitter_cldr-4.3.1 spec/shared/territory_spec.rb
twitter_cldr-4.3.0 spec/shared/territory_spec.rb
twitter_cldr-4.2.0 spec/shared/territory_spec.rb
twitter_cldr-4.1.0 spec/shared/territory_spec.rb
twitter_cldr-4.0.0 spec/shared/territory_spec.rb
twitter_cldr-3.6.0 spec/shared/territory_spec.rb
twitter_cldr-3.5.0 spec/shared/territory_spec.rb
twitter_cldr-3.4.0 spec/shared/territory_spec.rb
twitter_cldr-3.3.0 spec/shared/territory_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/twitter_cldr-3.2.1/spec/shared/territory_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/twitter_cldr-3.2.1/spec/shared/territory_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/twitter_cldr-3.1.2/spec/shared/territory_spec.rb
twitter_cldr-3.2.1 spec/shared/territory_spec.rb
twitter_cldr-3.2.0 spec/shared/territory_spec.rb
twitter_cldr-3.1.2 spec/shared/territory_spec.rb
twitter_cldr-3.1.1 spec/shared/territory_spec.rb
twitter_cldr-3.1.0 spec/shared/territory_spec.rb
twitter_cldr-3.0.10 spec/shared/territory_spec.rb
twitter_cldr-3.0.9 spec/shared/territory_spec.rb
twitter_cldr-3.0.8 spec/shared/territory_spec.rb