Sha256: d0ba7c37bdd9edf0ba83c3ff5e95a1d6050ee92b14bb520255578aa2667628a0

Contents?: true

Size: 511 Bytes

Versions: 1

Compression:

Stored size: 511 Bytes

Contents

require 'time'

describe "Time#strptime" do

  it "parses number of seconds since Unix Epoch" do
    Time.strptime('0', '%s').should == Time.at(0)
  end

  it "parses number of seconds since Unix Epoch as UTC" do
    Time.strptime('0', '%s').utc?.should == false
  end

  it "parses number of seconds since Unix Epoch with timezone" do
    Time.strptime('0 +0100', '%s %z').to_s.should == Time.at(0).getlocal('+01:00').to_s
    Time.strptime('0 +0100', '%s %z').strftime('%s %z').should == "0 +0100"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubysl-time-2.0.3 spec/strptime_spec.rb