Sha256: 068818b0b7255b6502ad9488ec1029b11578ae8e97e2c092182608393b6e323b

Contents?: true

Size: 900 Bytes

Versions: 6

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"
require "date"

describe RussianWorkdays::Year do
  before(:all) do
    @year = RussianWorkdays::Year.new(2014)
    @holidays = %w[2014-05-01 2014-05-02 2014-05-03 2014-05-04]
    @preholidays = %w[2014-02-24 2014-03-07 2014-04-30 2014-05-08 2014-06-11 2014-12-31]
    @works = %w[2014-05-05 2014-05-06 2014-05-06]
  end

  it "should return true if date is preholiday day" do
    @preholidays.each do |date|
      expect(RussianWorkdays::Day.new(Date.parse(date)).preholiday?).to eq(true)
    end
  end

  it "should return true if date is holiday day" do
    @holidays.each do |date|
      expect(RussianWorkdays::Day.new(Date.parse(date)).holiday?).to eq(true)
    end
  end

  it "should return true if date is work day" do
    @works.each do |date|
      expect(RussianWorkdays::Day.new(Date.parse(date)).work?).to eq(true)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
russian_workdays-2.6.0 spec/day_spec.rb
russian_workdays-2.5.0 spec/day_spec.rb
russian_workdays-2.4.0 spec/day_spec.rb
russian_workdays-2.3.0 spec/day_spec.rb
russian_workdays-2.1.0 spec/day_spec.rb
russian_workdays-2.0.0 spec/day_spec.rb