Sha256: 76e8d3662dbf9cf000c549071559f0c1fd5034dcd730b52cdb05cdff836d1591

Contents?: true

Size: 698 Bytes

Versions: 6

Compression:

Stored size: 698 Bytes

Contents

require(File.join(File.dirname(__FILE__), '..', 'datetime_spec_helper'))

describe "DateTime#eql?" do
  it "should be able determine equality between date objects" do
    DateTime.civil(2007, 10, 11).should eql(DateTime.civil(2007, 10, 11))
    DateTime.civil(2007, 10, 11, 10, 11, 12, 13).should eql(DateTime.civil(2007, 10, 11, 10, 11, 12, 13))
    DateTime.civil(2007, 10, 11, 10, 11, 12, 13).usec.should eql((DateTime.civil(2007, 10, 12, 10, 11, 12, 13) - 1).usec)
    DateTime.civil(2007, 10, 11, 10, 11, 12, 13).should eql(DateTime.civil(2007, 10, 12, 10, 11, 12, 13) - 1)
    DateTime.civil(2007, 10, 11, 10, 11, 12, 13).should_not eql(DateTime.civil(2007, 10, 11, 10, 11, 12, 12))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
third_base-1.3.0 spec/datetime/eql_spec.rb
third_base-1.2.0 spec/datetime/eql_spec.rb
third_base-1.1.1 spec/datetime/eql_spec.rb
third_base-1.1.0 spec/datetime/eql_spec.rb
third_base-1.0.0 spec/datetime/eql_spec.rb
third_base-1.0.1 spec/datetime/eql_spec.rb