예제 #1
0
        public void CanReQueueJobs()
        {
            Job.create("jobs", "resque.DummyJob", 20, "/tmp");
            Job job = Resque.Reserve("jobs");

            job.recreate();
            Assert.That(job, Is.EqualTo(Resque.Reserve("jobs")));
        }
예제 #2
0
        public void CanPutJobsOnTheQueueByAskingWhichQueueTheyAreInterestedIn()
        {
            Assert.That(0, Is.EqualTo(Resque.size("tester")));
            Assert.IsTrue(Resque.enqueue("resque.DummyJob", 20, "/tmp"));
            Assert.IsTrue(Resque.enqueue("resque.DummyJob", 20, "/tmp"));

            Job job = Resque.Reserve("tester");

            Assert.That(20, Is.EqualTo(job.args()[0]));
            Assert.That("/tmp", Is.EqualTo(job.args()[1]));
        }
예제 #3
0
        public void CanGrabJobsOffAQueue()
        {
            //Job.create("jobs", "dummy-job", 20, "/tmp"); FIXME NEED TO DEAL WITH THIS
            Job.create("jobs", "resque.DummyJob", 20, "/tmp");
            Job job = Resque.Reserve("jobs");

            Assert.AreEqual("resque.DummyJob", job.PayloadClass().FullName);
            var num = job.args()[0];

            Assert.AreEqual(20, num);
            Assert.That("/tmp", Is.EqualTo(job.args()[1]));
        }
예제 #4
0
        public void CanTestForEquality()
        {
            Assert.IsTrue(Job.create("jobs", "resque.DummyJob", 20, "/tmp"));
            Assert.IsTrue(Job.create("jobs", "resque.DummyJob", 20, "/tmp"));
            //Assert.IsTrue(Job.create("jobs", "dummy-job", 20, "/tmp"));  NEED TO  MAKE THIS WORK
            Assert.That(Resque.Reserve("jobs"), Is.EqualTo(Resque.Reserve("jobs")));

            Assert.IsTrue(Job.create("jobs", "resque.NotDummyJob", 20, "/tmp"));
            Assert.IsTrue(Job.create("jobs", "resque.DummyJob", 20, "/tmp"));
            Assert.That(Resque.Reserve("jobs"), Is.Not.EqualTo(Resque.Reserve("jobs")));

            Assert.IsTrue(Job.create("jobs", "resque.DummyJob", 20, "/tmp"));
            Assert.IsTrue(Job.create("jobs", "resque.DummyJob", 30, "/tmp"));
            Assert.That(Resque.Reserve("jobs"), Is.Not.EqualTo(Resque.Reserve("jobs")));
        }