Sha256: f27020ccb35df79720429032638b341daa75295e8aa715e59caff57280801023
Contents?: true
Size: 886 Bytes
Versions: 7
Compression:
Stored size: 886 Bytes
Contents
require 'spec_helper' require 'gorillib/datetime/to_flat' require 'gorillib/datetime/parse' describe Time, :datetime_spec => true do describe '#to_flat' do before do @time_utc = Time.parse("2011-02-03T04:05:06 UTC") @time_cst = Time.parse("2011-02-02T22:05:06-06:00") @time_flat = "20110203040506" end it 'converts times to UTC' do @time_utc.to_flat.should == @time_flat @time_cst.to_flat.should == @time_flat end it 'round-trips' do Time.parse_safely(@time_flat).to_flat.should == @time_flat Time.parse_safely(@time_utc.to_flat).should == @time_utc end end end describe Date, :datetime_spec => true do describe '#to_flat' do before do @date = Date.new(2011, 2, 3) @date_flat = "20110203" end it 'converts dates' do @date.to_flat.should == @date_flat end end end
Version data entries
7 entries across 7 versions & 1 rubygems