require 'spec_helper'

module Lantus
  describe AwesomeDate, "initialized with 'Jun 22 2012 9:00:12 AM'" do
    before :each do
      @awesome_date = AwesomeDate.new "Jun 22 2012 9:00:12 AM"
    end

    describe "time" do
      it "should be '09:00:12 BST'" do
        @awesome_date.time.should == "09:00:12 BST"
      end
    end

    describe "short time" do
      it "should be '09:00'" do
        @awesome_date.short_time.should == "09:00"
      end
    end

    describe "date" do
      it "should be '2012-06-22'" do
        @awesome_date.date.should == "2012-06-22"
      end
    end

    describe "day" do
      it "should be 'friday'" do
        @awesome_date.day.should == "friday"
      end
    end

    describe "cardinal day" do
      it "should be 22" do
        @awesome_date.cardinal_day.should ==  22
      end
    end

    describe "ordinal day" do
      it "should be '22nd'" do
        @awesome_date.ordinal_day.should == "22nd"
      end
    end

    describe "month" do
      it "should be 'june'" do
        @awesome_date.month.should == "june"
      end
    end

    describe "nice date" do
      it "should be 'friday june 22nd'" do
        @awesome_date.nice_date.should == "friday june 22nd"
      end
    end
  end
end