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

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