Add work hours calc
This commit is contained in:
6
spec/data/work-records.json
Normal file
6
spec/data/work-records.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"start": "2019-01-01 10:00:00",
|
||||
"finish": "2019-01-01 20:00:00"
|
||||
}
|
||||
]
|
@ -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
|
||||
|
Reference in New Issue
Block a user