Sha256: 9a2b2ef594b59bd882b308bd366f0acc424354c24a86e3f6a3f0dbe9bf17a1e4

Contents?: true

Size: 937 Bytes

Versions: 27

Compression:

Stored size: 937 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])
  		composite_token.tokens.map { |t| t.type }.should == ["my_type_0", "my_type_1"]
  		composite_token.tokens.map { |t| t.value }.should == ["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])
  		composite_token.to_s.should == "my_value_0my_value_1"
  	end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
twitter_cldr-1.6.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.5.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.4.1 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.4.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.3.6 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.3.0 spec/tokenizers/composite_token_spec.rb
twitter_cldr-1.2.0 spec/tokenizers/composite_token_spec.rb