Design question: Time-dependent behavior in get_window() #44
-
|
Hi, I was exploring quartz-api and noticed that Wouldn't this make the function time-dependent and harder to test |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @AnujNayak108, great to have you, and good point here. There are definitely a bunch of things like this across our active repos that we'll be looking to hunker down in the new year and weed out the... less ideal patterns, and untestable elements. 😁 Your suggestion makes total sense, and seems fairly self-contained as an implementation change as I see it (though I haven't looked for all the usages of the function), so by all means pop a PR up with an amended function that splits the logic out in this way with a new (default) Any questions though, on this or other repos, give us a shout! GL;HF 👍 |
Beta Was this translation helpful? Give feedback.
Hey @AnujNayak108, great to have you, and good point here. There are definitely a bunch of things like this across our active repos that we'll be looking to hunker down in the new year and weed out the... less ideal patterns, and untestable elements. 😁
Your suggestion makes total sense, and seems fairly self-contained as an implementation change as I see it (though I haven't looked for all the usages of the function), so by all means pop a PR up with an amended function that splits the logic out in this way with a new (default)
now()parameter if you'd like!I agree, this would be much easier to reason with firm test cases, and presume this was added in at some point to solve an immediate…