[英]Testing resque-scheduler
In resque-scheduler
, how do I rspec-test that some job is queued EVERY 30 seconds? 在
resque-scheduler
,我如何测试某个作业每30秒排队一次?
Here is my resque-scheduler.yml
file: 这是我的
resque-scheduler.yml
文件:
hipchat_schedule:
queue: hipchat
every: 30s
class: HipChatPolling
There is very useful resque_spec gem, but I am not sure if it can do test for every
-clause. 有非常有用的resque_spec gem,但我不确定它是否可以为
every
-clause进行测试。
First, I think this is tested - and have to be tested - by resque-scheduler
gem (or to be precise, in the rufus-scheduler
gem), not on your side. 首先,我认为这是通过
resque-scheduler
gem(或者准确地说,在rufus-scheduler
gem中)进行测试 - 并且必须进行测试 - 而不是在你身边。 If scheduling is not happened then it is not a bug in your application, but a bug in the gem. 如果没有安排调度,那么它不是您应用程序中的错误,而是gem中的错误。
But, if you want to test it anyway, you have two way to do it: 但是,如果你想测试它,你有两种方法可以做到:
Note, to do this, you have to be sure Resque.inline
setting is disabled before the test! 注意,要做到这一点,您必须确保在测试之前禁用
Resque.inline
设置!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.