Sha256: 9030aacc756ffd089e0d8110ea159263dec11dcc38846b4cfcae910dd172b542

Contents?: true

Size: 766 Bytes

Versions: 6

Compression:

Stored size: 766 Bytes

Contents

require 'insulin'

describe Insulin::OnTrack::Date do
  otd = Insulin::OnTrack::Date.new "Jun 22 2012 9:00:12 AM"

  it "should have the correct timestamp" do
    otd["timestamp"].to_s.should == "2012-06-22 09:00:12 +0100"
  end

  it "should have the correct time" do
    otd["time"].should == "09:00:12 BST"
  end

  it "should have the correct date" do
    otd["date"].should == "2012-06-22"
  end

  it "should have the correct day" do
    otd["day"].should == "friday"
  end

  otd_gmt = Insulin::OnTrack::Date.new "Jan 22 2012 9:00:12 PM"

  it "should have the correct timestamp" do
    otd_gmt["timestamp"].to_s.should == "2012-01-22 21:00:12 +0000"
  end

  it "should have the correct time and TZ" do
    otd_gmt["time"].should == "21:00:12 GMT"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
insulin-0.1.0 spec/on_track/date_spec.rb
insulin-0.0.18 spec/on_track/date_spec.rb
insulin-0.0.17 spec/on_track/date_spec.rb
insulin-0.0.16 spec/on_track/date_spec.rb
insulin-0.0.15 spec/on_track/date_spec.rb
insulin-0.0.14 spec/on_track/date_spec.rb