Sha256: bfe8bcd10ba9e2b289b49a5da80a284fefb53480793667426c9e194b38ae9d46

Contents?: true

Size: 616 Bytes

Versions: 26

Compression:

Stored size: 616 Bytes

Contents

# encoding: UTF-8

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

require 'spec_helper'

describe TwitterCldr::Parsers::SymbolTable do
  let(:table) { described_class.new(a: "b", c: "d") }

  describe "#fetch" do
    it "should be able to retrieve values for symbols" do
      expect(table.fetch(:a)).to eq("b")
      fetch = lambda { table.fetch(:z) }

      expect(fetch).to raise_error(KeyError)
    end
  end

  describe "#add" do
    it "should be able to add then fetch new values for symbols" do
      table.add(:e, "f")
      expect(table.fetch(:e)).to eq("f")
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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