Sha256: 6aa4d23841a58c3ee89eeb7f130d72b0c22148dcdb4249ac9d27f361fb49734c

Contents?: true

Size: 466 Bytes

Versions: 6

Compression:

Stored size: 466 Bytes

Contents

require 'spec_helper'
require 'dm_ruby_extensions'

describe Time do

  describe 'localize' do
    it 'localize the date based on the format' do
      I18n.enforce_available_locales = false
      I18n.locale = :en
      time = Time.parse("2012-11-23 08:35 utc")
      expect(time.localize).to eq 'Fri, 23 Nov 2012 08:35:00 +0000'
      expect(time.localize(format: :short)).to eq '23 Nov 08:35'
      expect(time.localize('%b %Y')).to eq 'Nov 2012'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dm_ruby_extensions-1.0.9 spec/extensions/time_spec.rb
dm_ruby_extensions-1.0.8 spec/extensions/time_spec.rb
dm_ruby_extensions-1.0.7 spec/extensions/time_spec.rb
dm_ruby_extensions-1.0.6 spec/extensions/time_spec.rb
dm_ruby_extensions-1.0.5 spec/extensions/time_spec.rb
dm_ruby_extensions-1.0.0 spec/extensions/time_spec.rb