cosmos 3.2.1 → 3.3.0

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.
Files changed (364) hide show
  1. checksums.yaml +4 -4
  2. data/Manifest.txt +195 -0
  3. data/README.md +3 -3
  4. data/data/crc.txt +52 -52
  5. data/lib/cosmos.rb +1 -1
  6. data/lib/cosmos/core_ext/time.rb +11 -9
  7. data/lib/cosmos/gui/choosers/telemetry_chooser.rb +0 -2
  8. data/lib/cosmos/gui/dialogs/about_dialog.rb +2 -2
  9. data/lib/cosmos/gui/dialogs/exception_dialog.rb +2 -2
  10. data/lib/cosmos/gui/dialogs/progress_dialog.rb +11 -5
  11. data/lib/cosmos/gui/dialogs/splash.rb +32 -10
  12. data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -1
  13. data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +2 -2
  14. data/lib/cosmos/gui/qt.rb +22 -22
  15. data/lib/cosmos/io/json_drb.rb +4 -4
  16. data/lib/cosmos/io/json_rpc.rb +21 -21
  17. data/lib/cosmos/packet_logs/packet_log_writer.rb +18 -20
  18. data/lib/cosmos/packets/commands.rb +8 -6
  19. data/lib/cosmos/packets/limits.rb +3 -2
  20. data/lib/cosmos/packets/packet.rb +14 -11
  21. data/lib/cosmos/packets/parsers/limits_parser.rb +1 -1
  22. data/lib/cosmos/packets/parsers/macro_parser.rb +4 -4
  23. data/lib/cosmos/packets/parsers/state_parser.rb +1 -1
  24. data/lib/cosmos/packets/structure.rb +2 -2
  25. data/lib/cosmos/packets/telemetry.rb +5 -4
  26. data/lib/cosmos/script/script.rb +6 -6
  27. data/lib/cosmos/streams/tcpip_socket_stream.rb +2 -1
  28. data/lib/cosmos/streams/template_stream_protocol.rb +1 -1
  29. data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +1 -1
  30. data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +5 -8
  31. data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +4 -3
  32. data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -3
  33. data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +15 -11
  34. data/lib/cosmos/tools/data_viewer/data_viewer.rb +1 -1
  35. data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +2 -2
  36. data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +2 -2
  37. data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +0 -2
  38. data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +1 -1
  39. data/lib/cosmos/tools/replay/replay.rb +2 -2
  40. data/lib/cosmos/tools/script_runner/script_audit.rb +1 -1
  41. data/lib/cosmos/tools/script_runner/script_runner.rb +1 -1
  42. data/lib/cosmos/tools/script_runner/script_runner_frame.rb +3 -7
  43. data/lib/cosmos/tools/table_manager/table_config.rb +1 -1
  44. data/lib/cosmos/tools/test_runner/results_writer.rb +1 -1
  45. data/lib/cosmos/tools/test_runner/test_runner.rb +2 -2
  46. data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +2 -1
  47. data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +1 -1
  48. data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +1 -0
  49. data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +1 -0
  50. data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +1 -0
  51. data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +3 -3
  52. data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +1 -3
  53. data/lib/cosmos/top_level.rb +2 -6
  54. data/lib/cosmos/utilities/ruby_lex_utils.rb +1 -1
  55. data/lib/cosmos/version.rb +5 -5
  56. data/lib/cosmos/win32/win32_main.rb +11 -7
  57. data/spec/ccsds/ccsds_packet_spec.rb +28 -28
  58. data/spec/ccsds/ccsds_parser_spec.rb +27 -27
  59. data/spec/config/config_parser_spec.rb +88 -88
  60. data/spec/conversions/conversion_spec.rb +3 -3
  61. data/spec/conversions/generic_conversion_spec.rb +9 -9
  62. data/spec/conversions/new_packet_log_conversion_spec.rb +4 -4
  63. data/spec/conversions/polynomial_conversion_spec.rb +7 -7
  64. data/spec/conversions/processor_conversion_spec.rb +9 -9
  65. data/spec/conversions/received_count_conversion_spec.rb +7 -7
  66. data/spec/conversions/received_time_formatted_conversion_spec.rb +9 -9
  67. data/spec/conversions/received_time_seconds_conversion_spec.rb +9 -9
  68. data/spec/conversions/segmented_polynomial_conversion_spec.rb +11 -11
  69. data/spec/conversions/unix_time_formatted_conversion_spec.rb +13 -13
  70. data/spec/conversions/unix_time_seconds_conversion_spec.rb +13 -13
  71. data/spec/core_ext/array_spec.rb +76 -76
  72. data/spec/core_ext/class_spec.rb +3 -3
  73. data/spec/core_ext/cosmos_io_spec.rb +16 -16
  74. data/spec/core_ext/exception_spec.rb +19 -19
  75. data/spec/core_ext/file_spec.rb +16 -16
  76. data/spec/core_ext/hash_spec.rb +3 -3
  77. data/spec/core_ext/io_spec.rb +2 -2
  78. data/spec/core_ext/kernel_spec.rb +2 -2
  79. data/spec/core_ext/math_spec.rb +43 -43
  80. data/spec/core_ext/matrix_spec.rb +22 -22
  81. data/spec/core_ext/objectspace_spec.rb +6 -6
  82. data/spec/core_ext/range_spec.rb +2 -2
  83. data/spec/core_ext/socket_spec.rb +4 -4
  84. data/spec/core_ext/string_spec.rb +67 -67
  85. data/spec/core_ext/stringio_spec.rb +2 -2
  86. data/spec/core_ext/time_spec.rb +82 -82
  87. data/spec/gui/line_graph/line_clip_spec.rb +34 -34
  88. data/spec/interfaces/interface_spec.rb +46 -46
  89. data/spec/interfaces/linc_interface_spec.rb +26 -26
  90. data/spec/interfaces/serial_interface_spec.rb +16 -16
  91. data/spec/interfaces/simulated_target_interface_spec.rb +21 -21
  92. data/spec/interfaces/stream_interface_spec.rb +22 -22
  93. data/spec/interfaces/tcpip_client_interface_spec.rb +14 -14
  94. data/spec/interfaces/tcpip_server_interface_spec.rb +41 -41
  95. data/spec/interfaces/udp_interface_spec.rb +46 -46
  96. data/spec/io/buffered_file_spec.rb +50 -50
  97. data/spec/io/io_multiplexer_spec.rb +9 -9
  98. data/spec/io/json_drb_object_spec.rb +7 -7
  99. data/spec/io/json_drb_spec.rb +55 -55
  100. data/spec/io/json_rpc_spec.rb +68 -68
  101. data/spec/io/raw_logger_pair_spec.rb +28 -28
  102. data/spec/io/raw_logger_spec.rb +22 -22
  103. data/spec/io/serial_driver_spec.rb +3 -3
  104. data/spec/io/stderr_spec.rb +2 -2
  105. data/spec/io/stdout_spec.rb +2 -2
  106. data/spec/io/tcpip_server_spec.rb +62 -62
  107. data/spec/io/udp_sockets_spec.rb +19 -19
  108. data/spec/io/win32_serial_driver_spec.rb +10 -10
  109. data/spec/packet_logs/meta_packet_log_writer_spec.rb +32 -32
  110. data/spec/packet_logs/packet_log_reader_spec.rb +138 -138
  111. data/spec/packet_logs/packet_log_writer_pair_spec.rb +3 -3
  112. data/spec/packet_logs/packet_log_writer_spec.rb +26 -26
  113. data/spec/packets/binary_accessor_spec.rb +672 -672
  114. data/spec/packets/commands_spec.rb +123 -123
  115. data/spec/packets/limits_response_spec.rb +1 -1
  116. data/spec/packets/limits_spec.rb +69 -69
  117. data/spec/packets/packet_config_spec.rb +93 -93
  118. data/spec/packets/packet_item_limits_spec.rb +46 -46
  119. data/spec/packets/packet_item_spec.rb +108 -108
  120. data/spec/packets/packet_spec.rb +364 -348
  121. data/spec/packets/parsers/format_string_parser_spec.rb +13 -13
  122. data/spec/packets/parsers/limits_parser_spec.rb +8 -8
  123. data/spec/packets/parsers/limits_response_parser_spec.rb +9 -9
  124. data/spec/packets/parsers/macro_parser_spec.rb +34 -6
  125. data/spec/packets/parsers/packet_parser_spec.rb +6 -6
  126. data/spec/packets/parsers/processor_parser_spec.rb +7 -7
  127. data/spec/packets/parsers/state_parser_spec.rb +23 -23
  128. data/spec/packets/structure_item_spec.rb +62 -62
  129. data/spec/packets/structure_spec.rb +183 -183
  130. data/spec/packets/telemetry_spec.rb +174 -174
  131. data/spec/processors/new_packet_log_processor_spec.rb +4 -4
  132. data/spec/processors/processor_spec.rb +9 -9
  133. data/spec/processors/statistics_processor_spec.rb +21 -21
  134. data/spec/processors/watermark_processor_spec.rb +12 -12
  135. data/spec/script/script_spec.rb +158 -158
  136. data/spec/spec_helper.rb +44 -13
  137. data/spec/streams/burst_stream_protocol_spec.rb +8 -8
  138. data/spec/streams/fixed_stream_protocol_spec.rb +26 -26
  139. data/spec/streams/length_stream_protocol_spec.rb +27 -27
  140. data/spec/streams/preidentified_stream_protocol_spec.rb +25 -25
  141. data/spec/streams/serial_stream_spec.rb +19 -19
  142. data/spec/streams/stream_protocol_spec.rb +52 -52
  143. data/spec/streams/stream_spec.rb +1 -1
  144. data/spec/streams/tcpip_client_stream_spec.rb +7 -7
  145. data/spec/streams/tcpip_socket_stream_spec.rb +84 -49
  146. data/spec/streams/template_stream_protocol_spec.rb +17 -17
  147. data/spec/streams/terminated_stream_protocol_spec.rb +19 -19
  148. data/spec/system/system_spec.rb +95 -95
  149. data/spec/system/target_spec.rb +32 -32
  150. data/spec/tools/cmd_tlm_server/api_spec.rb +386 -386
  151. data/spec/tools/cmd_tlm_server/background_task_spec.rb +3 -3
  152. data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +8 -8
  153. data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +57 -57
  154. data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +85 -85
  155. data/spec/tools/cmd_tlm_server/commanding_spec.rb +11 -11
  156. data/spec/tools/cmd_tlm_server/connections_spec.rb +23 -23
  157. data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +57 -57
  158. data/spec/tools/cmd_tlm_server/interfaces_spec.rb +32 -32
  159. data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +17 -17
  160. data/spec/tools/cmd_tlm_server/router_thread_spec.rb +15 -15
  161. data/spec/tools/cmd_tlm_server/routers_spec.rb +36 -36
  162. data/spec/top_level/top_level_spec.rb +60 -60
  163. data/spec/utilities/crc_spec.rb +6 -6
  164. data/spec/utilities/csv_spec.rb +13 -13
  165. data/spec/utilities/logger_spec.rb +20 -20
  166. data/spec/utilities/message_log_spec.rb +13 -13
  167. data/spec/utilities/quaternion_spec.rb +30 -30
  168. data/spec/utilities/ruby_lex_utils_spec.rb +14 -14
  169. data/test/benchmarks/binary_accessor_benchmark.rb +14 -0
  170. data/test/benchmarks/gsub_benchmark.rb +114 -0
  171. data/test/performance/PACKETS.bat +1 -0
  172. data/test/performance/Rakefile +77 -0
  173. data/test/performance/THREADS.bat +1 -0
  174. data/test/performance/config/data/attitude.bin +0 -0
  175. data/test/performance/config/data/crc.txt +206 -0
  176. data/test/performance/config/data/diamond.STL +58 -0
  177. data/test/performance/config/data/groundoff.gif +0 -0
  178. data/test/performance/config/data/groundon.gif +0 -0
  179. data/test/performance/config/data/hselectoff.gif +0 -0
  180. data/test/performance/config/data/hselecton.gif +0 -0
  181. data/test/performance/config/data/hswitchoff.gif +0 -0
  182. data/test/performance/config/data/hswitchon.gif +0 -0
  183. data/test/performance/config/data/meta_init.txt +4 -0
  184. data/test/performance/config/data/position.bin +0 -0
  185. data/test/performance/config/data/poweroff.gif +0 -0
  186. data/test/performance/config/data/poweron.gif +0 -0
  187. data/test/performance/config/data/satellite.gif +0 -0
  188. data/test/performance/config/data/tada.wav +0 -0
  189. data/test/performance/config/data/vswitchoff.gif +0 -0
  190. data/test/performance/config/data/vswitchon.gif +0 -0
  191. data/test/performance/config/system/system_packets.txt +39 -0
  192. data/test/performance/config/system/system_threads.txt +59 -0
  193. data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
  194. data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
  195. data/test/performance/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
  196. data/test/performance/config/targets/COSMOS/screens/limits_change.txt +20 -0
  197. data/test/performance/config/targets/COSMOS/screens/version.txt +19 -0
  198. data/test/performance/config/targets/COSMOS/target.txt +11 -0
  199. data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_cmds.txt +17 -0
  200. data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_tlm.txt +18 -0
  201. data/test/performance/config/targets/EXAMPLE/cmd_tlm_server.txt +6 -0
  202. data/test/performance/config/targets/EXAMPLE/lib/example_interface.rb +22 -0
  203. data/test/performance/config/targets/EXAMPLE/target.txt +7 -0
  204. data/test/performance/config/targets/SYSTEM/screens/status.txt +12 -0
  205. data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_packets.txt +34 -0
  206. data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_threads.txt +68 -0
  207. data/test/performance/config/tools/data_viewer/data_viewer.txt +11 -0
  208. data/test/performance/config/tools/handbook_creator/default_toc.xsl +59 -0
  209. data/test/performance/config/tools/handbook_creator/handbook_creator.txt +66 -0
  210. data/test/performance/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
  211. data/test/performance/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
  212. data/test/performance/config/tools/handbook_creator/templates/footer.html.erb +9 -0
  213. data/test/performance/config/tools/handbook_creator/templates/header.html.erb +25 -0
  214. data/test/performance/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
  215. data/test/performance/config/tools/handbook_creator/templates/nav.html.erb +27 -0
  216. data/test/performance/config/tools/handbook_creator/templates/overview.html.erb +1 -0
  217. data/test/performance/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
  218. data/test/performance/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
  219. data/test/performance/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
  220. data/test/performance/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
  221. data/test/performance/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
  222. data/test/performance/config/tools/handbook_creator/templates/title.html.erb +1 -0
  223. data/test/performance/config/tools/launcher/launcher_packets.txt +29 -0
  224. data/test/performance/config/tools/launcher/launcher_threads.txt +70 -0
  225. data/test/performance/config/tools/limits_monitor/README.txt +1 -0
  226. data/test/performance/config/tools/opengl_builder/README.txt +1 -0
  227. data/test/performance/config/tools/script_runner/script_runner.txt +3 -0
  228. data/test/performance/config/tools/table_manager/ConfigTables_def.txt +8 -0
  229. data/test/performance/config/tools/table_manager/ExampleTableDefinition.txt +24 -0
  230. data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +25 -0
  231. data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +25 -0
  232. data/test/performance/config/tools/table_manager/PPSSelectionTable_def.txt +8 -0
  233. data/test/performance/config/tools/table_manager/TLMMonitoringTable_def.txt +248 -0
  234. data/test/performance/config/tools/test_runner/test_runner.txt +17 -0
  235. data/test/performance/config/tools/tlm_extractor/tlm_extractor.txt +13 -0
  236. data/test/performance/config/tools/tlm_extractor/tlm_extractor2.txt +2 -0
  237. data/test/performance/config/tools/tlm_extractor/tlm_extractor3.txt +2 -0
  238. data/test/performance/config/tools/tlm_extractor/tlm_extractor4.txt +2 -0
  239. data/test/performance/config/tools/tlm_grapher/README.txt +1 -0
  240. data/test/performance/config/tools/tlm_viewer/tlm_viewer.txt +41 -0
  241. data/test/performance/lib/example_background_task.rb +57 -0
  242. data/test/performance/lib/example_target.rb +120 -0
  243. data/test/performance/lib/scpi_target.rb +74 -0
  244. data/test/performance/lib/user_version.rb +3 -0
  245. data/test/performance/outputs/handbooks/README.txt +1 -0
  246. data/test/performance/outputs/logs/README.txt +1 -0
  247. data/test/performance/outputs/saved_config/README.txt +1 -0
  248. data/test/performance/outputs/tables/README.txt +1 -0
  249. data/test/performance/outputs/tmp/README.txt +1 -0
  250. data/test/performance/procedures/checks.rb +11 -0
  251. data/test/performance/procedures/clear_util.rb +7 -0
  252. data/test/performance/procedures/collect.rb +18 -0
  253. data/test/performance/procedures/collect_util.rb +14 -0
  254. data/test/performance/procedures/cosmos_api_test.rb +293 -0
  255. data/test/performance/procedures/disconnect.rb +29 -0
  256. data/test/performance/procedures/example_test.rb +182 -0
  257. data/test/performance/procedures/plot_test.rb +8 -0
  258. data/test/performance/procedures/procedure.rb +3 -0
  259. data/test/performance/procedures/run_example_test.rb +3 -0
  260. data/test/performance/procedures/test.rb +51 -0
  261. data/test/performance/tools/CmdExtractor +14 -0
  262. data/test/performance/tools/CmdExtractor.bat +59 -0
  263. data/test/performance/tools/CmdSender +14 -0
  264. data/test/performance/tools/CmdSender.bat +59 -0
  265. data/test/performance/tools/CmdTlmServer +16 -0
  266. data/test/performance/tools/CmdTlmServer.bat +59 -0
  267. data/test/performance/tools/CmdTlmServerMemProf +20 -0
  268. data/test/performance/tools/CmdTlmServerMemProf.bat +59 -0
  269. data/test/performance/tools/DataViewer +14 -0
  270. data/test/performance/tools/DataViewer.bat +59 -0
  271. data/test/performance/tools/ExampleTarget +14 -0
  272. data/test/performance/tools/ExampleTarget.bat +59 -0
  273. data/test/performance/tools/HandbookCreator +14 -0
  274. data/test/performance/tools/HandbookCreator.bat +61 -0
  275. data/test/performance/tools/Launcher +14 -0
  276. data/test/performance/tools/Launcher.bat +59 -0
  277. data/test/performance/tools/LimitsMonitor +14 -0
  278. data/test/performance/tools/LimitsMonitor.bat +59 -0
  279. data/test/performance/tools/OpenGLBuilder +14 -0
  280. data/test/performance/tools/OpenGLBuilder.bat +59 -0
  281. data/test/performance/tools/PacketViewer +14 -0
  282. data/test/performance/tools/PacketViewer.bat +59 -0
  283. data/test/performance/tools/Replay +14 -0
  284. data/test/performance/tools/Replay.bat +59 -0
  285. data/test/performance/tools/ScpiTarget +14 -0
  286. data/test/performance/tools/ScpiTarget.bat +59 -0
  287. data/test/performance/tools/ScriptRunner +14 -0
  288. data/test/performance/tools/ScriptRunner.bat +59 -0
  289. data/test/performance/tools/TableManager +14 -0
  290. data/test/performance/tools/TableManager.bat +59 -0
  291. data/test/performance/tools/TestRunner +14 -0
  292. data/test/performance/tools/TestRunner.bat +59 -0
  293. data/test/performance/tools/TlmExtractor +14 -0
  294. data/test/performance/tools/TlmExtractor.bat +59 -0
  295. data/test/performance/tools/TlmGrapher +14 -0
  296. data/test/performance/tools/TlmGrapher.bat +59 -0
  297. data/test/performance/tools/TlmViewer +14 -0
  298. data/test/performance/tools/TlmViewer.bat +59 -0
  299. data/test/performance/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
  300. data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
  301. data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
  302. data/test/performance/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
  303. data/test/performance/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
  304. data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
  305. data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
  306. data/test/performance/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
  307. data/test/performance/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
  308. data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
  309. data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
  310. data/test/performance/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
  311. data/test/performance/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
  312. data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
  313. data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
  314. data/test/performance/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
  315. data/test/performance/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
  316. data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
  317. data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
  318. data/test/performance/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
  319. data/test/performance/tools/mac/Launcher.app/Contents/Info.plist +38 -0
  320. data/test/performance/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
  321. data/test/performance/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
  322. data/test/performance/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
  323. data/test/performance/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
  324. data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
  325. data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
  326. data/test/performance/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
  327. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
  328. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
  329. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
  330. data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
  331. data/test/performance/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
  332. data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
  333. data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
  334. data/test/performance/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
  335. data/test/performance/tools/mac/Replay.app/Contents/Info.plist +38 -0
  336. data/test/performance/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
  337. data/test/performance/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
  338. data/test/performance/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
  339. data/test/performance/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
  340. data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
  341. data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
  342. data/test/performance/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
  343. data/test/performance/tools/mac/TableManager.app/Contents/Info.plist +38 -0
  344. data/test/performance/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
  345. data/test/performance/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
  346. data/test/performance/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
  347. data/test/performance/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
  348. data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
  349. data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
  350. data/test/performance/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
  351. data/test/performance/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
  352. data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
  353. data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
  354. data/test/performance/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
  355. data/test/performance/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
  356. data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
  357. data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
  358. data/test/performance/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
  359. data/test/performance/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
  360. data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
  361. data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
  362. data/test/performance/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
  363. data/test/performance/userpath.txt +1 -0
  364. metadata +197 -2
@@ -16,58 +16,58 @@ module Cosmos
16
16
  describe RawLoggerPair do
17
17
 
18
18
  describe "initialize" do
19
- it "should set the write logger and read logger" do
19
+ it "sets the write logger and read logger" do
20
20
  pair = RawLoggerPair.new('MYINT')
21
- pair.read_logger.should_not be_nil
22
- pair.write_logger.should_not be_nil
23
- pair.read_logger.logging_enabled.should be_falsey
24
- pair.write_logger.logging_enabled.should be_falsey
21
+ expect(pair.read_logger).not_to be_nil
22
+ expect(pair.write_logger).not_to be_nil
23
+ expect(pair.read_logger.logging_enabled).to be_falsey
24
+ expect(pair.write_logger.logging_enabled).to be_falsey
25
25
 
26
26
  pair = RawLoggerPair.new('MYINT2', ['raw_logger.rb', true, 100000, './'])
27
- pair.read_logger.should_not be_nil
28
- pair.write_logger.should_not be_nil
29
- pair.read_logger.logging_enabled.should be_truthy
30
- pair.write_logger.logging_enabled.should be_truthy
27
+ expect(pair.read_logger).not_to be_nil
28
+ expect(pair.write_logger).not_to be_nil
29
+ expect(pair.read_logger.logging_enabled).to be_truthy
30
+ expect(pair.write_logger.logging_enabled).to be_truthy
31
31
  end
32
32
  end
33
33
 
34
34
  describe "start" do
35
- it "should start logging" do
35
+ it "starts logging" do
36
36
  pair = RawLoggerPair.new('MYINT')
37
37
  pair.start
38
- pair.write_logger.logging_enabled.should be_truthy
39
- pair.read_logger.logging_enabled.should be_truthy
38
+ expect(pair.write_logger.logging_enabled).to be_truthy
39
+ expect(pair.read_logger.logging_enabled).to be_truthy
40
40
  end
41
41
  end
42
42
 
43
43
  describe "stop" do
44
- it "should stop logging" do
44
+ it "stops logging" do
45
45
  pair = RawLoggerPair.new('MYINT')
46
46
  pair.start
47
- pair.write_logger.logging_enabled.should be_truthy
48
- pair.read_logger.logging_enabled.should be_truthy
47
+ expect(pair.write_logger.logging_enabled).to be_truthy
48
+ expect(pair.read_logger.logging_enabled).to be_truthy
49
49
  pair.stop
50
- pair.write_logger.logging_enabled.should be_falsey
51
- pair.read_logger.logging_enabled.should be_falsey
50
+ expect(pair.write_logger.logging_enabled).to be_falsey
51
+ expect(pair.read_logger.logging_enabled).to be_falsey
52
52
  end
53
53
  end
54
54
 
55
55
  describe "clone" do
56
- it "should clone itself including logging state" do
56
+ it "clones itself including logging state" do
57
57
  pair = RawLoggerPair.new('MYINT')
58
- pair.write_logger.logging_enabled.should be_falsey
59
- pair.read_logger.logging_enabled.should be_falsey
58
+ expect(pair.write_logger.logging_enabled).to be_falsey
59
+ expect(pair.read_logger.logging_enabled).to be_falsey
60
60
  pair_clone1 = pair.clone
61
61
  pair.start
62
- pair.write_logger.logging_enabled.should be_truthy
63
- pair.read_logger.logging_enabled.should be_truthy
64
- pair_clone1.write_logger.logging_enabled.should be_falsey
65
- pair_clone1.read_logger.logging_enabled.should be_falsey
62
+ expect(pair.write_logger.logging_enabled).to be_truthy
63
+ expect(pair.read_logger.logging_enabled).to be_truthy
64
+ expect(pair_clone1.write_logger.logging_enabled).to be_falsey
65
+ expect(pair_clone1.read_logger.logging_enabled).to be_falsey
66
66
  pair_clone2 = pair.clone
67
- pair_clone1.write_logger.logging_enabled.should be_falsey
68
- pair_clone1.read_logger.logging_enabled.should be_falsey
69
- pair_clone2.write_logger.logging_enabled.should be_truthy
70
- pair_clone2.read_logger.logging_enabled.should be_truthy
67
+ expect(pair_clone1.write_logger.logging_enabled).to be_falsey
68
+ expect(pair_clone1.read_logger.logging_enabled).to be_falsey
69
+ expect(pair_clone2.write_logger.logging_enabled).to be_truthy
70
+ expect(pair_clone2.read_logger.logging_enabled).to be_truthy
71
71
  end
72
72
  end
73
73
 
@@ -23,25 +23,25 @@ module Cosmos
23
23
  end
24
24
 
25
25
  describe "initialize" do
26
- it "should complain with an unknown log type" do
26
+ it "complains with an unknown log type" do
27
27
  expect { RawLogger.new(:BOTH) }.to raise_error
28
28
  end
29
29
 
30
- it "should create a raw write log" do
30
+ it "creates a raw write log" do
31
31
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 100000, nil)
32
32
  raw_logger.write("\x00\x01\x02\0x3")
33
33
  raw_logger.stop
34
34
  expect(Dir[File.join(@log_path,"*.bin")][-1]).to match("myint_raw_write")
35
35
  end
36
36
 
37
- it "should create a raw read log" do
37
+ it "creates a raw read log" do
38
38
  raw_logger = RawLogger.new('MYINT', :READ, true, 100000, nil)
39
39
  raw_logger.write("\x00\x01\x02\0x3")
40
40
  raw_logger.stop
41
41
  expect(Dir[File.join(@log_path,"*.bin")][-1]).to match("myint_raw_read")
42
42
  end
43
43
 
44
- it "should use the log directory" do
44
+ it "uses the log directory" do
45
45
  raw_logger = RawLogger.new('raw_logger_spec_', :READ, true, 100000, Cosmos::USERPATH)
46
46
  raw_logger.write("\x00\x01\x02\0x3")
47
47
  raw_logger.stop
@@ -53,7 +53,7 @@ module Cosmos
53
53
  end
54
54
 
55
55
  describe "write" do
56
- it "should write synchronously to a log" do
56
+ it "writes synchronously to a log" do
57
57
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 100000, nil)
58
58
  raw_logger.write("\x00\x01\x02\x03")
59
59
  raw_logger.stop
@@ -61,70 +61,70 @@ module Cosmos
61
61
  File.open(Dir[File.join(@log_path,"*.bin")][-1],'rb') do |file|
62
62
  data = file.read
63
63
  end
64
- data.should eql "\x00\x01\x02\x03"
64
+ expect(data).to eql "\x00\x01\x02\x03"
65
65
  end
66
66
 
67
- it "should not write data if logging is disabled" do
67
+ it "does not write data if logging is disabled" do
68
68
  raw_logger = RawLogger.new('MYINT', :WRITE, false, 100000, nil)
69
69
  raw_logger.write("\x00\x01\x02\x03")
70
- Dir[File.join(@log_path,"*.bin")].should be_empty
70
+ expect(Dir[File.join(@log_path,"*.bin")]).to be_empty
71
71
  end
72
72
 
73
- it "should cycle the log when it a size" do
73
+ it "cycles the log when it a size" do
74
74
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 200000, nil)
75
75
  raw_logger.write("\x00\x01\x02\x03" * 25000) # size 100000
76
76
  raw_logger.write("\x00\x01\x02\x03" * 25000) # size 200000
77
- Dir[File.join(@log_path,"*.bin")].length.should eql 1
77
+ expect(Dir[File.join(@log_path,"*.bin")].length).to eql 1
78
78
  sleep(2)
79
79
  raw_logger.write("\x00") # size 200001
80
80
  raw_logger.stop
81
81
  files = Dir[File.join(@log_path,"*.bin")]
82
- files.length.should eql 2
82
+ expect(files.length).to eql 2
83
83
  end
84
84
 
85
- it "should handle errors creating the log file" do
85
+ it "handles errors creating the log file" do
86
86
  capture_io do |stdout|
87
87
  allow(File).to receive(:new) { raise "Error" }
88
88
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 200, nil)
89
89
  raw_logger.write("\x00\x01\x02\x03")
90
90
  raw_logger.stop
91
- stdout.string.should match "Error opening"
91
+ expect(stdout.string).to match "Error opening"
92
92
  end
93
93
  end
94
94
 
95
- it "should handle errors closing the log file" do
95
+ it "handles errors closing the log file" do
96
96
  capture_io do |stdout|
97
97
  allow(File).to receive(:chmod) { raise "Error" }
98
98
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 200, nil)
99
99
  raw_logger.write("\x00\x01\x02\x03")
100
100
  raw_logger.stop
101
- stdout.string.should match "Error closing"
101
+ expect(stdout.string).to match "Error closing"
102
102
  end
103
103
  end
104
104
 
105
- it "should handle errors writing the log file" do
105
+ it "handles errors writing the log file" do
106
106
  capture_io do |stdout|
107
107
  raw_logger = RawLogger.new('MYINT', :WRITE, true, 200, nil)
108
108
  raw_logger.write("\x00\x01\x02\x03")
109
109
  allow(raw_logger.instance_variable_get(:@file)).to receive(:write) { raise "Error" }
110
110
  raw_logger.write("\x00\x01\x02\x03")
111
111
  raw_logger.stop
112
- stdout.string.should match "Error writing"
112
+ expect(stdout.string).to match "Error writing"
113
113
  end
114
114
  end
115
115
  end
116
116
 
117
117
  describe "start and stop" do
118
- it "should enable and disable logging" do
118
+ it "enables and disable logging" do
119
119
  raw_logger = RawLogger.new('MYINT', :WRITE, false, 200, nil)
120
- raw_logger.logging_enabled.should be_falsey
120
+ expect(raw_logger.logging_enabled).to be_falsey
121
121
  raw_logger.start
122
- raw_logger.logging_enabled.should be_truthy
122
+ expect(raw_logger.logging_enabled).to be_truthy
123
123
  raw_logger.write("\x00\x01\x02\x03")
124
124
  raw_logger.stop
125
- raw_logger.logging_enabled.should be_falsey
125
+ expect(raw_logger.logging_enabled).to be_falsey
126
126
  file = Dir[File.join(@log_path,"*.bin")][-1]
127
- File.size(file).should_not eql 0
127
+ expect(File.size(file)).not_to eql 0
128
128
  end
129
129
  end
130
130
 
@@ -17,13 +17,13 @@ module Cosmos
17
17
  describe SerialDriver do
18
18
 
19
19
  describe "instance" do
20
- it "should enforce the parity to a known value" do
20
+ it "enforces the parity to a known value" do
21
21
  expect { SerialDriver.new('COM1',9600,:BLAH) }.to raise_error(ArgumentError, "Invalid parity: BLAH")
22
22
  end
23
23
  end
24
24
 
25
25
  describe "close, closed?, write, read" do
26
- it "should defer to the windows serial driver on windows" do
26
+ it "defers to the windows serial driver on windows" do
27
27
  allow(Kernel).to receive(:is_windows?).and_return(true)
28
28
  driver = double("Win32SerialDriver")
29
29
  expect(driver).to receive(:close)
@@ -38,7 +38,7 @@ module Cosmos
38
38
  driver.read
39
39
  end
40
40
 
41
- it "should defer to the posix serial driver on nix" do
41
+ it "defers to the posix serial driver on nix" do
42
42
  class PosixSerialDriver
43
43
  end
44
44
  allow(Kernel).to receive(:is_windows?).and_return(false)
@@ -16,13 +16,13 @@ module Cosmos
16
16
  describe Stderr do
17
17
 
18
18
  describe "instance" do
19
- it "should return a single instance" do
19
+ it "returns a single instance" do
20
20
  expect(Stderr.instance).to eq(Stderr.instance)
21
21
  end
22
22
  end
23
23
 
24
24
  describe "puts" do
25
- it "should write to STDERR" do
25
+ it "writes to STDERR" do
26
26
  expect($stderr).to receive(:puts).with("TEST")
27
27
  Stderr.instance.puts("TEST")
28
28
  end
@@ -16,13 +16,13 @@ module Cosmos
16
16
  describe Stdout do
17
17
 
18
18
  describe "instance" do
19
- it "should return a single instance" do
19
+ it "returns a single instance" do
20
20
  expect(Stdout.instance).to eq(Stdout.instance)
21
21
  end
22
22
  end
23
23
 
24
24
  describe "puts" do
25
- it "should write to STDOUT" do
25
+ it "writes to STDOUT" do
26
26
  expect($stdout).to receive(:puts).with("TEST")
27
27
  Stdout.instance.puts("TEST")
28
28
  end
@@ -16,13 +16,13 @@ module Cosmos
16
16
  describe TcpipServer do
17
17
 
18
18
  describe "instance" do
19
- it "should rescue bad stream protocol names" do
19
+ it "rescues bad stream protocol names" do
20
20
  expect { TcpipServer.new(8888,8889,nil,nil,'Unknown') }.to raise_error(/Unable to require/)
21
21
  end
22
22
  end
23
23
 
24
24
  describe "connect, connected?, disconnect" do
25
- it "should only allow connect once" do
25
+ it "only allows connect once" do
26
26
  server = TcpipServer.new(nil,8889,nil,nil,'Burst')
27
27
  server.connect
28
28
  sleep 0.2
@@ -31,62 +31,62 @@ module Cosmos
31
31
  sleep(0.2)
32
32
  end
33
33
 
34
- it "should create a listener thread for the read port" do
34
+ it "creates a listener thread for the read port" do
35
35
  server = TcpipServer.new(nil,8889,nil,nil,'Burst')
36
36
  server.connect
37
37
  sleep 0.2
38
- server.connected?.should be_truthy
38
+ expect(server.connected?).to be_truthy
39
39
  # 2 because the RSpec main thread plus the listener
40
- Thread.list.length.should eql 2
40
+ expect(Thread.list.length).to eql 2
41
41
  server.disconnect
42
42
  sleep 0.2
43
- server.connected?.should be_falsey
44
- Thread.list.length.should eql 1
43
+ expect(server.connected?).to be_falsey
44
+ expect(Thread.list.length).to eql 1
45
45
  end
46
46
 
47
- it "should create a listener thread for the write port" do
47
+ it "creates a listener thread for the write port" do
48
48
  server = TcpipServer.new(8888,nil,nil,nil,'Burst')
49
49
  server.connect
50
50
  sleep 0.2
51
- server.connected?.should be_truthy
51
+ expect(server.connected?).to be_truthy
52
52
  # 3 because the RSpec main thread plus the listener
53
53
  # plus one for the write thread
54
- Thread.list.length.should eql 3
54
+ expect(Thread.list.length).to eql 3
55
55
  server.disconnect
56
56
  sleep 0.2
57
- server.connected?.should be_falsey
58
- Thread.list.length.should eql 1
57
+ expect(server.connected?).to be_falsey
58
+ expect(Thread.list.length).to eql 1
59
59
  end
60
60
 
61
- it "should create a single listener thread if read = write port" do
61
+ it "creates a single listener thread if read = write port" do
62
62
  server = TcpipServer.new(8888,8888,nil,nil,'Burst')
63
63
  server.connect
64
64
  sleep 0.2
65
- server.connected?.should be_truthy
65
+ expect(server.connected?).to be_truthy
66
66
  # 3 because the RSpec main thread plus the listener
67
67
  # plus one for the write thread
68
- Thread.list.length.should eql 3
68
+ expect(Thread.list.length).to eql 3
69
69
  server.disconnect
70
70
  sleep 0.2
71
- server.connected?.should be_falsey
72
- Thread.list.length.should eql 1
71
+ expect(server.connected?).to be_falsey
72
+ expect(Thread.list.length).to eql 1
73
73
  end
74
74
 
75
- it "should create a two listener threads if read != write port" do
75
+ it "creates a two listener threads if read != write port" do
76
76
  server = TcpipServer.new(8888,8889,nil,nil,'Burst')
77
77
  server.connect
78
78
  sleep 0.2
79
- server.connected?.should be_truthy
79
+ expect(server.connected?).to be_truthy
80
80
  # 4 because the RSpec main thread plus the two listeners
81
81
  # plus one for the write thread
82
- Thread.list.length.should eql 4
82
+ expect(Thread.list.length).to eql 4
83
83
  server.disconnect
84
84
  sleep 0.2
85
- server.connected?.should be_falsey
86
- Thread.list.length.should eql 1
85
+ expect(server.connected?).to be_falsey
86
+ expect(Thread.list.length).to eql 1
87
87
  end
88
88
 
89
- it "should log an error if the listener thread dies" do
89
+ it "logs an error if the listener thread dies" do
90
90
  capture_io do |stdout|
91
91
  system = double("System")
92
92
  allow(system).to receive(:use_dns) { raise "Error" }
@@ -101,15 +101,15 @@ module Cosmos
101
101
  socket.close
102
102
  sleep(0.2)
103
103
 
104
- stdout.string.should match /Tcpip server listen thread unexpectedly died/
104
+ expect(stdout.string).to match /Tcpip server listen thread unexpectedly died/
105
105
  end
106
106
  end
107
107
  end
108
108
 
109
109
  describe "read" do
110
- it "should return nil if there is no read port" do
110
+ it "returns nil if there is no read port" do
111
111
  server = TcpipServer.new(8888,nil,nil,nil,'Burst')
112
- server.read.should be_nil
112
+ expect(server.read).to be_nil
113
113
  server.disconnect
114
114
  sleep(0.2)
115
115
  end
@@ -119,7 +119,7 @@ module Cosmos
119
119
  #~ lambda { server.read }.should raise_error
120
120
  #~ end
121
121
 
122
- it "should read from the client" do
122
+ it "reads from the client" do
123
123
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
124
124
  allow(System).to receive_message_chain(:instance, :acl).and_return(false)
125
125
 
@@ -130,17 +130,17 @@ module Cosmos
130
130
  socket = TCPSocket.open("127.0.0.1",8889)
131
131
  socket.write("\x00\x01")
132
132
  sleep 0.2
133
- server.num_clients.should eql 1
134
- server.read_queue_size.should eql 1
135
- server.read.should be_a Packet
133
+ expect(server.num_clients).to eql 1
134
+ expect(server.read_queue_size).to eql 1
135
+ expect(server.read).to be_a Packet
136
136
  server.disconnect
137
137
  sleep 0.2
138
- server.num_clients.should eql 0
138
+ expect(server.num_clients).to eql 0
139
139
  socket.close
140
140
  sleep(0.2)
141
141
  end
142
142
 
143
- it "should check the client against the ACL" do
143
+ it "checks the client against the ACL" do
144
144
  capture_io do |stdout|
145
145
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
146
146
  allow(System).to receive_message_chain(:instance, :acl).and_return(true)
@@ -151,18 +151,18 @@ module Cosmos
151
151
  sleep 0.2
152
152
  socket = TCPSocket.open("127.0.0.1",8889)
153
153
  sleep 0.2
154
- server.num_clients.should eql 0
155
- socket.eof?.should be_truthy
154
+ expect(server.num_clients).to eql 0
155
+ expect(socket.eof?).to be_truthy
156
156
  server.disconnect
157
157
  sleep 0.2
158
158
  socket.close
159
159
  sleep(0.2)
160
160
 
161
- stdout.string.should match /Tcpip server rejected connection/
161
+ expect(stdout.string).to match /Tcpip server rejected connection/
162
162
  end
163
163
  end
164
164
 
165
- it "should log an error if the stream protocol can't disconnect" do
165
+ it "logs an error if the stream protocol can't disconnect" do
166
166
  capture_io do |stdout|
167
167
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
168
168
  allow(System).to receive_message_chain(:instance, :acl).and_return(false)
@@ -176,15 +176,15 @@ module Cosmos
176
176
  sleep 0.2
177
177
  server.disconnect
178
178
  sleep 0.2
179
- server.num_clients.should eql 0
179
+ expect(server.num_clients).to eql 0
180
180
  socket.close
181
181
  sleep(0.2)
182
182
 
183
- stdout.string.should match /Tcpip server read thread unexpectedly died/
183
+ expect(stdout.string).to match /Tcpip server read thread unexpectedly died/
184
184
  end
185
185
  end
186
186
 
187
- it "should log an error if the read thread dies" do
187
+ it "logs an error if the read thread dies" do
188
188
  capture_io do |stdout|
189
189
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
190
190
  allow(System).to receive_message_chain(:instance, :acl).and_return(false)
@@ -200,18 +200,18 @@ module Cosmos
200
200
  socket.close
201
201
  sleep(0.2)
202
202
 
203
- stdout.string.should match /Tcpip server read thread unexpectedly died/
203
+ expect(stdout.string).to match /Tcpip server read thread unexpectedly died/
204
204
  end
205
205
  end
206
206
  end
207
207
 
208
208
  describe "write" do
209
- it "should do nothing if there is no write port" do
209
+ it "does nothing if there is no write port" do
210
210
  server = TcpipServer.new(nil,8889,nil,nil,'Burst')
211
211
  expect { server.write(Packet.new('TGT','PKT')) }.to_not raise_error
212
212
  end
213
213
 
214
- it "should write to the client" do
214
+ it "writes to the client" do
215
215
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
216
216
  allow(System).to receive_message_chain(:instance, :acl).and_return(false)
217
217
 
@@ -221,22 +221,22 @@ module Cosmos
221
221
 
222
222
  socket = TCPSocket.open("127.0.0.1",8888)
223
223
  sleep 0.2
224
- server.num_clients.should eql 1
224
+ expect(server.num_clients).to eql 1
225
225
  packet = Packet.new("TGT","PKT")
226
226
  packet.buffer = "\x01\x02\x03\x04"
227
- server.write_queue_size.should eql 0
227
+ expect(server.write_queue_size).to eql 0
228
228
  server.write(packet)
229
229
  sleep 0.2
230
230
  data = socket.read_nonblock(packet.length)
231
- data.length.should eql 4
231
+ expect(data.length).to eql 4
232
232
  server.disconnect
233
233
  sleep 0.2
234
- server.num_clients.should eql 0
234
+ expect(server.num_clients).to eql 0
235
235
  socket.close
236
236
  sleep(0.2)
237
237
  end
238
238
 
239
- it "should log an error if the write thread dies" do
239
+ it "logs an error if the write thread dies" do
240
240
  class MyTcpipServer3 < TcpipServer
241
241
  def write_thread_hook(packet)
242
242
  raise "Error"
@@ -251,15 +251,15 @@ module Cosmos
251
251
  sleep 0.2
252
252
  socket = TCPSocket.open("127.0.0.1",8888)
253
253
  sleep 0.2
254
- server.num_clients.should eql 1
254
+ expect(server.num_clients).to eql 1
255
255
  server.write(Packet.new("TGT","PKT"))
256
256
  sleep 0.2
257
- server.num_clients.should eql 0
257
+ expect(server.num_clients).to eql 0
258
258
  server.disconnect
259
259
  socket.close
260
260
  sleep(0.2)
261
261
 
262
- stdout.string.should match /Tcpip server write thread unexpectedly died/
262
+ expect(stdout.string).to match /Tcpip server write thread unexpectedly died/
263
263
  end
264
264
  end
265
265
 
@@ -272,20 +272,20 @@ module Cosmos
272
272
 
273
273
  server = TcpipServer.new(8888,8889,nil,nil,'Burst')
274
274
  server.connect
275
- server.num_clients.should eql 0
275
+ expect(server.num_clients).to eql 0
276
276
  sleep 0.2
277
277
  socket = TCPSocket.open("127.0.0.1",8888)
278
278
  sleep 0.2
279
- server.num_clients.should eql 0
279
+ expect(server.num_clients).to eql 0
280
280
  server.disconnect
281
281
  socket.close
282
282
  sleep(0.2)
283
283
 
284
- stdout.string.should match /Tcpip server lost write connection/
284
+ expect(stdout.string).to match /Tcpip server lost write connection/
285
285
  end
286
286
  end
287
287
 
288
- it "should log an error if the client disconnects" do
288
+ it "logs an error if the client disconnects" do
289
289
  capture_io do |stdout|
290
290
  allow(System).to receive_message_chain(:instance, :use_dns).and_return(false)
291
291
  allow(System).to receive_message_chain(:instance, :acl).and_return(false)
@@ -298,36 +298,36 @@ module Cosmos
298
298
  socket1 = TCPSocket.open("127.0.0.1",8888)
299
299
  socket2 = TCPSocket.open("127.0.0.1",8889)
300
300
  sleep 0.5
301
- server.num_clients.should eql 2
301
+ expect(server.num_clients).to eql 2
302
302
  packet = Packet.new("TGT","PKT")
303
303
  packet.buffer = "\x01\x02\x03\x04"
304
- server.write_queue_size.should eql 0
304
+ expect(server.write_queue_size).to eql 0
305
305
  server.write(packet)
306
306
  sleep 0.2
307
- server.num_clients.should eql 1
307
+ expect(server.num_clients).to eql 1
308
308
  server.disconnect
309
309
  socket1.close
310
310
  socket2.close
311
311
  sleep(0.2)
312
312
 
313
- stdout.string.should match /Tcpip server lost write connection/
313
+ expect(stdout.string).to match /Tcpip server lost write connection/
314
314
  end
315
315
  end
316
316
  end
317
317
 
318
318
  describe "read_queue_size" do
319
- it "should return 0 if there is no read port" do
319
+ it "returns 0 if there is no read port" do
320
320
  server = TcpipServer.new(8888,nil,nil,nil,'Burst')
321
- server.read_queue_size.should eql 0
321
+ expect(server.read_queue_size).to eql 0
322
322
  server.disconnect
323
323
  sleep(0.2)
324
324
  end
325
325
  end
326
326
 
327
327
  describe "write_queue_size" do
328
- it "should return 0 if there is no write port" do
328
+ it "returns 0 if there is no write port" do
329
329
  server = TcpipServer.new(nil,8889,nil,nil,'Burst')
330
- server.write_queue_size.should eql 0
330
+ expect(server.write_queue_size).to eql 0
331
331
  server.disconnect
332
332
  sleep(0.2)
333
333
  end