File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ require_relative '../spec_helpers'
2+
3+
4+ describe KRPC ::Doc do
5+
6+ describe KRPC ::Doc ::SuffixMethods do
7+ include_context "test client support"
8+
9+ specify "_doc suffix methods" do
10+ expect { @test_client . test_service_doc } . to output ( "\e [0;36;49mClient\e [0m\e [0;36;49m#\e [0m\e [1;39;49mtest_service\e [0m() :\e [0;91;49mTestService\e [0m \n \n \e [0;94;49m Service documentation string. \e [0m\n " ) . to_stdout
11+ expect { @test_service . create_test_object_doc } . to output ( "\e [0;36;49mTestService\e [0m\e [0;36;49m.\e [0m\e [1;39;49mcreate_test_object\e [0m(\n \t \e [0;92;49mvalue\e [0m :String\n ) :\e [0;91;49mTestClass\e [0m \n \n " ) . to_stdout
12+
13+ obj = @test_service . create_test_object ( "foo" )
14+ expect { obj . get_value_doc } . to output ( "\e [0;36;49mTestService::TestClass\e [0m\e [0;36;49m#\e [0m\e [1;39;49mget_value\e [0m() :\e [0;91;49mString\e [0m \n \n \e [0;94;49m Method documentation string. \e [0m\n " ) . to_stdout
15+ obj . int_property = 0
16+ int_property_setter_docstring = "\e [0;36;49mTestService::TestClass\e [0m\e [0;36;49m#\e [0m\e [1;39;49mint_property=\e [0m(\n \t \e [0;92;49mvalue\e [0m :Integer\n ) :\e [0;91;49mnil\e [0m \n \n \e [0;94;49m Property documentation string. \e [0m\n "
17+ expect { obj . send ( 'int_property=_doc' ) } . to output ( int_property_setter_docstring ) . to_stdout
18+ expect { obj . int_property_doc = 1 } . to output ( int_property_setter_docstring ) . to_stdout
19+ expect ( obj . int_property ) . to eq 0
20+ end
21+
22+ specify ".krpc_name" do
23+ expect ( @test_client . class . krpc_name ) . to eq "Client"
24+ expect ( @test_service . class . krpc_name ) . to eq "TestService"
25+ obj = @test_service . create_test_object ( "foo" )
26+ expect ( obj . class . krpc_name ) . to eq "TestService::TestClass"
27+ end
28+ end
29+
30+ end
You can’t perform that action at this time.
0 commit comments