require File.dirname(__FILE__) + '/../../spec_helper'

describe 'CGI#rfc1123_date' do
  it 'should spec something' do
    raise 'not yet'
  end
end

require 'cgi'
require File.dirname(__FILE__) + '/../../spec_helper'


describe "CGI::rfc1123_date" do

  it "convert Time object into RFC1123 format such as 'Sat, 01 Dec 2007 15:56:42 GMT'" do
    sec = 1196524602
    input = Time.at(sec)
    expected = 'Sat, 01 Dec 2007 15:56:42 GMT'
    CGI.rfc1123_date(input).should == expected
  end

  it "raise error when argument is not Time object" do
    str = 'Sat, 01 Dec 2007 15:56:42 GMT'
    lambda { CGI.rfc1123_date(str) }.should raise_error(Exception)  # NoMethodError
  end

end

Add spec file for CGI::rfc1123_date().
Add spec file for CGI::rfc1123_date().

Signed-off-by: Eero Saynatkari <0177bde8141a5cae83aa68d349f2b0f6a47123ee@projects.kittensoft.org>
