Sha256: 5cd4558acb3014f0834cbb471ef4ffd1d2cba63015b2d84e526e6497a9cfd53b

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

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

describe "Kronos from_hash" do

  it "2002" do
    k = Kronos.from_hash({
      'year' => 2002,
    })
    k.year.should == 2002
    k.month.should == nil
    k.day.should == nil
  end

  it "November 2002" do
    k = Kronos.from_hash({
      'year' => 2002,
      'month' => 11,
    })
    k.year.should == 2002
    k.month.should == 11
    k.day.should == nil
  end

  it "November 9, 2002" do
    k = Kronos.from_hash({
      'year' => 2002,
      'month' => 11,
      'day'   => 9,
    })
    k.year.should == 2002
    k.month.should == 11
    k.day.should == 9
  end

  it "Malformed: ? 9, 2002" do
    k = Kronos.from_hash({
      'year' => 2002,
      'month' => nil,
      'day'   => 9,
    })
    k.should == nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kronos-0.1.10 spec/from_hash_spec.rb
kronos-0.1.9 spec/from_hash_spec.rb