Sha256: 5399067d57630f9b2473783609fecfcfafc3646cb0443cf05427922d0ca619b7

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

#
# ActiveFacts tests: Value instances in the Runtime API
# Copyright (c) 2008 Clifford Heath. Read the LICENSE file.
#
require 'activefacts/api'

describe Date do
  it "should construct with no arguments" do
    proc {
      @d = Date.new()
    }.should_not raise_error
    @d.year.should == -4712
  end

  it "should construct with a nil argument" do
    proc {
      @d = Date.new(nil)
    }.should_not raise_error
    @d.year.should == -4712
  end

  it "should construct with a full arguments" do
    proc {
      @d = Date.civil(2012, 10, 31)
    }.should_not raise_error
    @d.to_s.should == "2012-10-31"
  end

=begin
  it "should be encodable in JSON" do
    proc {
      @d = Date.new(2012, 10, 31)
      @d.to_json.should == "REVISIT"
    }.should_not raise_error
  end
=end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activefacts-api-0.9.3 spec/object_type/value_type/date_time_spec.rb