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

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/twitter_cldr-3.2.1/spec/tokenizers/composite_token_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/twitter_cldr-3.2.1/spec/tokenizers/composite_token_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/twitter_cldr-3.1.2/spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.2.1 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.2.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.1.2 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.1.1 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.1.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.10 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.9 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.8 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.7 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.6 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.5 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.4 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.3 spec/tokenizers/composite_token_spec.rb
twitter_cldr-3.0.2 spec/tokenizers/composite_token_spec.rb