@@ -12,40 +12,23 @@ def load_requirements
1212 refute subclass . available?
1313 end
1414
15- def test_select_adapter_class_with_rbczmq
16- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , true do
17- IRuby ::SessionAdapter ::CztopAdapter . stub :available? , false do
18- IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , false do
19- IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , false do
20- cls = IRuby ::SessionAdapter . select_adapter_class
21- assert_equal IRuby ::SessionAdapter ::RbczmqAdapter , cls
22- end
23- end
24- end
25- end
26- end
27-
2815 def test_select_adapter_class_with_cztop
2916 IRuby ::SessionAdapter ::CztopAdapter . stub :available? , true do
30- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , false do
31- IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , false do
32- IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , false do
33- cls = IRuby ::SessionAdapter . select_adapter_class
34- assert_equal IRuby ::SessionAdapter ::CztopAdapter , cls
35- end
17+ IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , false do
18+ IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , false do
19+ cls = IRuby ::SessionAdapter . select_adapter_class
20+ assert_equal IRuby ::SessionAdapter ::CztopAdapter , cls
3621 end
3722 end
3823 end
3924 end
4025
4126 def test_select_adapter_class_with_ffirzmq
4227 IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , true do
43- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , false do
44- IRuby ::SessionAdapter ::CztopAdapter . stub :available? , false do
45- IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , false do
46- cls = IRuby ::SessionAdapter . select_adapter_class
47- assert_equal IRuby ::SessionAdapter ::FfirzmqAdapter , cls
48- end
28+ IRuby ::SessionAdapter ::CztopAdapter . stub :available? , false do
29+ IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , false do
30+ cls = IRuby ::SessionAdapter . select_adapter_class
31+ assert_equal IRuby ::SessionAdapter ::FfirzmqAdapter , cls
4932 end
5033 end
5134 end
@@ -54,30 +37,16 @@ def test_select_adapter_class_with_ffirzmq
5437 def test_select_adapter_class_with_pyzmq
5538 skip "pyzmq adapter is disabled"
5639 IRuby ::SessionAdapter ::PyzmqAdapter . stub :available? , true do
57- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , false do
58- IRuby ::SessionAdapter ::CztopAdapter . stub :available? , false do
59- IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , false do
60- cls = IRuby ::SessionAdapter . select_adapter_class
61- assert_equal IRuby ::SessionAdapter ::PyzmqAdapter , cls
62- end
40+ IRuby ::SessionAdapter ::CztopAdapter . stub :available? , false do
41+ IRuby ::SessionAdapter ::FfirzmqAdapter . stub :available? , false do
42+ cls = IRuby ::SessionAdapter . select_adapter_class
43+ assert_equal IRuby ::SessionAdapter ::PyzmqAdapter , cls
6344 end
6445 end
6546 end
6647 end
6748
6849 def test_select_adapter_class_with_env
69- with_env ( 'IRUBY_SESSION_ADAPTER' => 'rbczmq' ) do
70- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , true do
71- assert_equal IRuby ::SessionAdapter ::RbczmqAdapter , IRuby ::SessionAdapter . select_adapter_class
72- end
73-
74- IRuby ::SessionAdapter ::RbczmqAdapter . stub :available? , false do
75- assert_raises IRuby ::SessionAdapterNotFound do
76- IRuby ::SessionAdapter . select_adapter_class
77- end
78- end
79- end
80-
8150 with_env ( 'IRUBY_SESSION_ADAPTER' => 'cztop' ) do
8251 IRuby ::SessionAdapter ::CztopAdapter . stub :available? , true do
8352 assert_equal IRuby ::SessionAdapter ::CztopAdapter , IRuby ::SessionAdapter . select_adapter_class
0 commit comments