Sha256: e0890e78a33afc8ef06ef5a4f54d18f4b08b3c14913c9690e04294a0e95b9312

Contents?: true

Size: 805 Bytes

Versions: 34

Compression:

Stored size: 805 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

require 'spec_helper'

include TwitterCldr::Tokenizers

describe TimespanTokenizer do

  describe "#tokens" do
    it "should return the correct list of tokens" do
      tokenizer = TimespanTokenizer.new(nil)
      tokenizer.tokenize("Hace {0} minutos").tap do |tokens|
        tokens[0].tap do |token|
          expect(token.value).to eq("Hace ")
          expect(token.type).to eq(:plaintext)
        end

        tokens[1].tap do |token|
          expect(token.value).to eq("{0}")
          expect(token.type).to eq(:pattern)
        end

        tokens[2].tap do |token|
          expect(token.value).to eq(" minutos")
          expect(token.type).to eq(:plaintext)
        end
      end
    end
  end

end

Version data entries

34 entries across 34 versions & 3 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/twitter_cldr-4.4.5/spec/tokenizers/calendars/timespan_tokenizer_spec.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/twitter_cldr-4.4.5/spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.5 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.4 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.3 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.2 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.1 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.4.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.3.1 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.3.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.2.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.1.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-4.0.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-3.6.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-3.5.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-3.4.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-3.3.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/twitter_cldr-3.2.1/spec/tokenizers/calendars/timespan_tokenizer_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/twitter_cldr-3.2.1/spec/tokenizers/calendars/timespan_tokenizer_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/twitter_cldr-3.1.2/spec/tokenizers/calendars/timespan_tokenizer_spec.rb