Add work hours calc

This commit is contained in:
2019-11-03 12:23:17 +03:00
parent e236a1bdac
commit 3195a14bb3
3 changed files with 46 additions and 5 deletions

View File

@ -0,0 +1,6 @@
[
{
"start": "2019-01-01 10:00:00",
"finish": "2019-01-01 20:00:00"
}
]

View File

@ -2,7 +2,18 @@ require "./spec_helper"
describe Dayoff do
it "can calc work hours" do
app = Dayoff::App.new("./spec/data/planned-dates.json")
app.get_work_hours.should eq 20
app = Dayoff::App.new(
"./spec/data/planned-dates.json",
"./spec/data/work-records.json",
)
app.get_planned_hours.should eq 20
end
it "can calc work hours" do
app = Dayoff::App.new(
"./spec/data/planned-dates.json",
"./spec/data/work-records.json",
)
app.get_work_hours.should eq 10
end
end