Sha256: 56f43885b8677d157fc094e5853e164ab514defd1587bfc5a6b998a80f80d113

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

# encoding: UTF-8

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

require 'spec_helper'

include TwitterCldr::Tokenizers

describe "Calendars" do
  it "makes sure datetime formatters for every locale don't raise errors" do
    TwitterCldr.supported_locales.each do |locale|
      DateTimeTokenizer::VALID_TYPES.each do |type|
        lambda { DateTime.now.localize(locale).send(:"to_#{type}_s") }.should_not raise_error
      end
    end
  end

  it "makes sure date formatters for every locale don't raise errors" do
    TwitterCldr.supported_locales.each do |locale|
      DateTimeTokenizer::VALID_TYPES.each do |type|
        lambda { Date.today.localize(locale).send(:"to_#{type}_s") }.should_not raise_error
      end
    end
  end

  it "makes sure time formatters for every locale don't raise errors" do
    TwitterCldr.supported_locales.each do |locale|
      DateTimeTokenizer::VALID_TYPES.each do |type|
        lambda { Time.now.localize(locale).send(:"to_#{type}_s") }.should_not raise_error
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
twitter_cldr-1.7.0 spec/core_ext/calendars_spec.rb
twitter_cldr-1.6.2 spec/core_ext/calendars_spec.rb
twitter_cldr-1.6.1 spec/core_ext/calendars_spec.rb
twitter_cldr-1.6.0 spec/core_ext/calendars_spec.rb
twitter_cldr-1.5.0 spec/core_ext/calendars_spec.rb