Skip to content

Commit 1e7b6a8

Browse files
committed
Add test for .best returning threaded container.
1 parent dda76e8 commit 1e7b6a8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/async/container.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
end
2727
end
2828

29-
it "can get best container class" do
30-
expect(Async::Container.best_container_class).not.to be_nil
31-
end
32-
3329
with ".new" do
3430
let(:container) {Async::Container.new}
3531

@@ -38,4 +34,16 @@
3834
container.stop
3935
end
4036
end
37+
38+
with ".best" do
39+
it "can get the best container class" do
40+
expect(Async::Container.best_container_class).not.to be_nil
41+
end
42+
43+
it "can get the best container class if fork is not available" do
44+
expect(subject).to receive(:fork?).and_return(false)
45+
46+
expect(Async::Container.best_container_class).to be == Async::Container::Threaded
47+
end
48+
end
4149
end

0 commit comments

Comments
 (0)