Sha256: 07c01165f56faa9d76928678e23c9c7a9600a2fce1cf78a75ef1db9046077c50

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'
require 'rest_helper'

describe CreateTime do
  before( :all ) do
    reset_database 
    ActiveOrient::OrientSetup.init_database 
  end
  context "check environment" do
    it "nessesary classes are allocated" do
      [ Monat, Tag, Stunde ].each do | klass |
	expect( klass.superclass).to eq TimeBase
      end
    end
  end

  context "populate" do
    before( :all ) do
       CreateTime.populate_month
    end
    let( :month){  Date.today.month }

    it "The actual Month is used" do
      expect( Monat.count ).to eq 1
      expect( Monat.first.value ).to eq  Date.today.month
    end

    it "The actual Month has several days" do
      expect( Monat.first.tag.count ).to be >= 28
    end

    it	"Address a specific day", focus: true do

      expect( Monat[month].tag[5].value ).to eq 5
    end

    it "Address a specific hour" do
      expect( Monat[month].tag[5].value ).to eq 5
      expect( Monat[month].tag[7].stunde[5].value ).to eq 5
    end
    it "Switch to the next hour" do

      expect( Monat[month].tag[7].stunde[5].next.value ).to eq 6
    end
  end




end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active-orient-0.5 examples/time_graph/spec/lib/create_time_spec.rb