Sha256: 67724e698cd25d1f25d876ec76f4c5338c048f8403239c8ea2ad66951193d83c

Contents?: true

Size: 895 Bytes

Versions: 24

Compression:

Stored size: 895 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Date do
  
  subject { Date.today }
  
  describe "#start_of_frequency" do
    
    context "given valid input" do
      it "should return the beginning of the month" do
        subject.start_of_frequency(:monthly).should eq Date.today.beginning_of_month
      end
    end
    
    context "given invalid input" do
      it "should return the date" do
        subject.start_of_frequency(:hippo).should eq Date.today
      end
    end
    
  end
  
  describe "#end_of_frequency" do
    
    context "given valid input" do
      it "should return the beginning of the month" do
        subject.end_of_frequency(:monthly).should eq Date.today.end_of_month
      end
    end
    
    context "given invalid input" do
      it "should return the date" do
        subject.end_of_frequency(:hippo).should eq Date.today
      end
    end
    
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
quandl_operation-0.4.1 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.4.0 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.3.2 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.3.1 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.3.0 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.2.1 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.2.0 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.23 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.22 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.21 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.20 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.19 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.18 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.17 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.16 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.15 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.14 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.13 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.12 spec/lib/quandl/operation/date_spec.rb
quandl_operation-0.1.11 spec/lib/quandl/operation/date_spec.rb