Sha256: 75c397c2bd12d93662b31459e0771ea87144896cdb03c501513acac062b297a8

Contents?: true

Size: 796 Bytes

Versions: 27

Compression:

Stored size: 796 Bytes

Contents

# encoding: UTF-8

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

require 'spec_helper'

describe TwitterCldr::Tokenizers::TimespanTokenizer do

  describe "#tokens" do
    it "should return the correct list of tokens" do
      tokenizer = described_class.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

27 entries across 27 versions & 1 rubygems

Version Path
twitter_cldr-6.0.1 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-6.0.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-5.4.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-5.3.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-5.2.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-5.1.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb
twitter_cldr-5.0.0 spec/tokenizers/calendars/timespan_tokenizer_spec.rb