Skip to content

WorkingHours.return_to_working_time() doesn't pass .in_working_hours? #28

Open
@rafalyesware

Description

@rafalyesware

When one returns a time to working time, it would seem sensible that the time actually passes the .in_working_hours? test in all cases.

However, if the time passed to return_to_working_time was outside working hours to start with, then WorkingHours.return_to_working_time will return a time that does not pass the .in_working_hours? predicate (because it returns the exact closing time).

See for example:

2.2.2 :006 > Time.now.in_working_hours?
=> false
2.2.2 :007 > WorkingHours.return_to_working_time(Time.now).in_working_hours? 
=> false
2.2.2 :008 > (WorkingHours.return_to_working_time(Time.now) - 1.second).in_working_hours?
=> true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions