Skip to content

Commit

Permalink
InsertsItselfIntoTheWorkersListOnStartup
Browse files Browse the repository at this point in the history
  • Loading branch information
chad committed Feb 11, 2010
1 parent 90b3898 commit b79deb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resque-sharp/Resque.cs
Expand Up @@ -34,6 +34,11 @@ public static Worker[] working()
return Worker.working();
}

public static Worker[] workers()
{
return Worker.all();
}

public static bool Push(string queue, object item)
{
watchQueue(queue);
Expand Down
10 changes: 10 additions & 0 deletions tests/WorkerTest.cs
Expand Up @@ -48,5 +48,15 @@ public void KnowsWhoIsWorking()
});
}

[Test]
public void InsertsItselfIntoTheWorkersListOnStartup()
{
worker.work(0,
(Job job) =>
{
Assert.That(Resque.workers()[0].workerId(), Is.EqualTo(worker.workerId())); return true;
});
}

}
}

0 comments on commit b79deb3

Please sign in to comment.