coordinator 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/coordinator/queue.rb +1 -1
- data/lib/coordinator/version.rb +1 -1
- data/test/unit/queue_test.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b9b6ba779147361654af8dfb5d700a76af248f
|
4
|
+
data.tar.gz: 612324d3b10fd5e318d4989825d5f4c0bf73526b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da2d76c3c896ce14b7c7ad70b8f9d1d09171c34f1c041024cae7a8948a251d7fba1742874635abe63cf5c027b30582d0fe2fd27b753b92541c626b1f805bb095
|
7
|
+
data.tar.gz: 27b01986357e2f16ac9d5c8a6992972895cbf712f560cb3f2210851b52570943cbedbe3653000868cbba3693c325eec4b3ab783722d6da7b49d9803c8991289e
|
data/lib/coordinator/queue.rb
CHANGED
data/lib/coordinator/version.rb
CHANGED
data/test/unit/queue_test.rb
CHANGED
@@ -51,12 +51,13 @@ describe "Coordinator::Queue" do
|
|
51
51
|
|
52
52
|
it "can override default behaviour" do
|
53
53
|
queue = Coordinator::Queue.new("normal") do |task, skills|
|
54
|
+
return true if skills.include?(name) && skills.include?("online")
|
54
55
|
return true if skills.include?("low")
|
55
56
|
return true if task == 4
|
56
57
|
task == 3 && skills.include?("special")
|
57
58
|
end
|
58
|
-
refute queue.eligible?(2, ["special"])
|
59
59
|
refute queue.eligible?(nil, ["normal"]), "default behaviour"
|
60
|
+
assert queue.eligible?(2, ["normal", "online"]), "access queue variables"
|
60
61
|
assert queue.eligible?(2, ["low"]), "override through skill"
|
61
62
|
assert queue.eligible?(4, []), "override through task"
|
62
63
|
assert queue.eligible?(3, ["special"]), "override through both"
|