Sha256: 0da972267acbf2f0162e2362ea471ac2859d3ac08c447b06cd2610187708c314
Contents?: true
Size: 952 Bytes
Versions: 17
Compression:
Stored size: 952 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