mirror of
https://github.com/plashchynski/crono.git
synced 2026-03-31 22:53:14 +02:00
Check period duration to be at least 1 day when using 'at'
This commit is contained in:
@@ -78,6 +78,12 @@ describe Crono::Period do
|
||||
}.to raise_error("Unknown 'at' format")
|
||||
end
|
||||
|
||||
it 'should raise error when period is less than 1 day' do
|
||||
expect {
|
||||
Crono::Period.new(5.hours, at: '15:30')
|
||||
}.to raise_error("period should be at least 1 day to use 'at'")
|
||||
end
|
||||
|
||||
it 'should return time in relation to last time' do
|
||||
@period = Crono::Period.new(2.day)
|
||||
expect(@period.next(since: 1.day.ago)).to be_eql(1.day.from_now)
|
||||
|
||||
Reference in New Issue
Block a user