Sha256: 8834a26287aed398133ef763bfd3866c35cefba085d59eaa255a86d5ccd7d0ad

Contents?: true

Size: 619 Bytes

Versions: 17

Compression:

Stored size: 619 Bytes

Contents

# encoding: UTF-8

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

require 'spec_helper'

include TwitterCldr::Parsers

describe SymbolTable do
  let(:table) { SymbolTable.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

17 entries across 17 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/twitter_cldr-4.4.5/spec/parsers/symbol_table_spec.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/twitter_cldr-4.4.5/spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.5 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.4 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.3 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.2 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.1 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.4.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.3.1 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.3.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.2.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.1.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-4.0.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-3.6.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-3.5.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-3.4.0 spec/parsers/symbol_table_spec.rb
twitter_cldr-3.3.0 spec/parsers/symbol_table_spec.rb