Sha256: 2638cadae9b3503198d6c1010797c2e4c75efe1bb175fdb295df3e41b6cf9aec

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

# -*- coding: utf-8 -*-
require 'minitest/autorun'
require 'simplecov'
SimpleCov.start

describe Fab do

  let(:fab){ Fab.new }

  describe "#datetime" do    

    before do
      @x = fab.datetime
    end

    it "is a datetime" do
      @x.must_be_kind_of DateTime
    end
  end

  describe "#datetime_min" do    

    before do
      @x = fab.datetime_min
    end

    it "returns a datetime" do
      @x.must_be_kind_of DateTime
    end

  end

  describe "#datetime_min=" do    

    before do
      @x = DateTime.now
    end

    it "sets & gets" do
      fab.datetime_min = @x
      fab.datetime_min.must_equal @x
    end

  end

  describe "#datetime_max" do    

    before do
      @x = fab.datetime_max
    end

    it "returns a datetime" do
      @x.must_be_kind_of DateTime
    end

  end

  describe "#datetime_max=" do    

    before do
      @x = DateTime.now
    end

    it "sets & gets" do
      fab.datetime_max = @x
      fab.datetime_max.must_equal @x
    end

  end

  describe "#start_datetime" do    

    before do
      @x = fab.start_datetime
    end

    it "is a datetime" do
      @x.must_be_kind_of DateTime
    end

  end

  describe "#stop_datetime" do    

    before do
      @x = fab.stop_datetime
    end

    it "is a datetime" do
      @x.must_be_kind_of DateTime
    end

  end

  describe "#start_datetime_and_stop_datetime" do    

    before do
      @start, @stop = @x = fab.start_datetime_and_stop_datetime
    end

    it "is an array" do
      @x.must_be_kind_of Array
    end

    it "contains a start datetime and stop datetime" do
      @start.must_be_kind_of DateTime
      @stop.must_be_kind_of DateTime
    end

    it "ensures start <= stop" do
      @start.must_be :<=, @stop
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sixarm_ruby_fab-1.0.2 test/sixarm_ruby_fab_test/datetime_test.rb
sixarm_ruby_fab-1.0.1 test/sixarm_ruby_fab_test/datetime_test.rb