Sha256: 0df5610565939066059e0ee3909f1d4a9a9bb24609072f3b887c43d318c5f973
Contents?: true
Size: 928 Bytes
Versions: 17
Compression:
Stored size: 928 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 require 'spec_helper' include TwitterCldr::Tokenizers describe CompositeToken do describe "#initialize" do it "should set an array of tokens" do token_0 = Token.new(type: "my_type_0", value: "my_value_0") token_1 = Token.new(type: "my_type_1", value: "my_value_1") composite_token = CompositeToken.new([token_0, token_1]) expect(composite_token.tokens.map { |t| t.type }).to eq(["my_type_0", "my_type_1"]) expect(composite_token.tokens.map { |t| t.value }).to eq(["my_value_0", "my_value_1"]) end it "should return content" do token_0 = Token.new(type: "my_type_0", value: "my_value_0") token_1 = Token.new(type: "my_type_1", value: "my_value_1") composite_token = CompositeToken.new([token_0, token_1]) expect(composite_token.to_s).to eq("my_value_0my_value_1") end end end
Version data entries
17 entries across 17 versions & 2 rubygems