russian_workdays 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -154
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -1
- data/README.md +0 -2
- data/Rakefile +2 -2
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/{russian_workdays/dates.yml → dates.yml} +85 -121
- data/lib/russian_workdays/collection.rb +34 -14
- data/lib/russian_workdays/collection_preset.rb +12 -4
- data/lib/russian_workdays/day.rb +19 -11
- data/lib/russian_workdays/missing_year_error.rb +16 -0
- data/lib/russian_workdays/month.rb +15 -3
- data/lib/russian_workdays/version.rb +1 -1
- data/lib/russian_workdays/year.rb +13 -2
- data/lib/russian_workdays.rb +13 -4
- data/russian_workdays.gemspec +16 -13
- data/spec/lib/collection_spec.rb +84 -0
- data/spec/lib/day_spec.rb +135 -0
- data/spec/lib/month_spec.rb +62 -0
- data/spec/lib/year_spec.rb +50 -0
- data/spec/spec_helper.rb +2 -2
- metadata +44 -29
- data/.codeclimate.yml +0 -16
- data/.travis.yml +0 -3
- data/spec/collection_spec.rb +0 -27
- data/spec/day_spec.rb +0 -31
- data/spec/month_spec.rb +0 -27
- data/spec/year_spec.rb +0 -27
data/spec/month_spec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "spec_helper"
|
4
|
-
|
5
|
-
describe RussianWorkdays::Month do
|
6
|
-
before(:all) do
|
7
|
-
@month = RussianWorkdays::Month.new(2014, 5)
|
8
|
-
@holidays = %w[2014-05-01 2014-05-02 2014-05-03 2014-05-04]
|
9
|
-
@preholidays = %w[2014-05-08]
|
10
|
-
@works = %w[2014-05-05 2014-05-06 2014-05-06]
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should return the right preholiday days" do
|
14
|
-
preholidays = @month.preholidays.map(&:to_s)
|
15
|
-
expect(preholidays).to eq(@preholidays)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should return the right holydays" do
|
19
|
-
holidays = @month.holidays.map(&:to_s)
|
20
|
-
expect(holidays).to include(*@holidays)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should return the right preholiday works" do
|
24
|
-
works = @month.works.map(&:to_s)
|
25
|
-
expect(works).to include(*@works)
|
26
|
-
end
|
27
|
-
end
|
data/spec/year_spec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "spec_helper"
|
4
|
-
|
5
|
-
describe RussianWorkdays::Year do
|
6
|
-
before(:all) do
|
7
|
-
@year = RussianWorkdays::Year.new(2014)
|
8
|
-
@holidays = %w[2014-05-01 2014-05-02 2014-05-03 2014-05-04]
|
9
|
-
@preholidays = %w[2014-02-24 2014-03-07 2014-04-30 2014-05-08 2014-06-11 2014-12-31]
|
10
|
-
@works = %w[2014-05-05 2014-05-06 2014-05-06]
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should return the right preholiday days" do
|
14
|
-
preholidays = @year.preholidays.map(&:to_s)
|
15
|
-
expect(preholidays).to eq(@preholidays)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should return the right holydays" do
|
19
|
-
holidays = @year.holidays.map(&:to_s)
|
20
|
-
expect(holidays).to include(*@holidays)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should return the right preholiday works" do
|
24
|
-
works = @year.works.map(&:to_s)
|
25
|
-
expect(works).to include(*@works)
|
26
|
-
end
|
27
|
-
end
|