spec/async/container/shared_examples.rb in async-container-0.10.0 vs spec/async/container/shared_examples.rb in async-container-0.10.1
- old
+ new
@@ -31,6 +31,19 @@
subject.wait
output.close
expect(input.read).to be == "Hello World"
end
+
+ it "can run concurrently" do
+ subject.async(name: "Sleepy Jerry") do |task, instance|
+ 3.times do |i|
+ puts "Counting Sheep #{i}"
+ instance.name = "Counting Sheep #{i}"
+
+ sleep 0.01
+ end
+ end
+
+ subject.wait
+ end
end