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
@@ -17,20 +17,20 @@ module Cosmos
17
17
 
18
18
  describe TemplateStreamProtocol do
19
19
  describe "initialize" do
20
- it "should initialize attributes" do
20
+ it "initializes attributes" do
21
21
  tsp = TemplateStreamProtocol.new('0xABCD','0xABCD')
22
- tsp.bytes_read.should eql 0
23
- tsp.bytes_written.should eql 0
24
- tsp.interface.should be_nil
25
- tsp.stream.should be_nil
26
- tsp.post_read_data_callback.should be_nil
27
- tsp.post_read_packet_callback.should be_nil
28
- tsp.pre_write_packet_callback.should be_nil
22
+ expect(tsp.bytes_read).to eql 0
23
+ expect(tsp.bytes_written).to eql 0
24
+ expect(tsp.interface).to be_nil
25
+ expect(tsp.stream).to be_nil
26
+ expect(tsp.post_read_data_callback).to be_nil
27
+ expect(tsp.post_read_packet_callback).to be_nil
28
+ expect(tsp.pre_write_packet_callback).to be_nil
29
29
  end
30
30
  end
31
31
 
32
32
  describe "connect" do
33
- it "should support an initial read delay" do
33
+ it "supports an initial read delay" do
34
34
  class MyStream1 < Stream
35
35
  def connect; end
36
36
  def read_nonblock; []; end
@@ -44,7 +44,7 @@ module Cosmos
44
44
  end
45
45
 
46
46
  describe "disconnect" do
47
- it "should unblock the read queue" do
47
+ it "unblocks the read queue" do
48
48
  tsp = TemplateStreamProtocol.new('0xABCD','0xABCD')
49
49
  class MyStream1 < Stream
50
50
  def connect; end
@@ -63,7 +63,7 @@ module Cosmos
63
63
  end
64
64
 
65
65
  describe "read" do
66
- it "should read packets from the stream" do
66
+ it "reads packets from the stream" do
67
67
  class MyStream < Stream
68
68
  def connect; end
69
69
  def connected?; true; end
@@ -86,12 +86,12 @@ module Cosmos
86
86
  $buffer1 = "\x00\x01\x02\xAB"
87
87
  $buffer2 = "\xCD\x44\x02\x03"
88
88
  packet = tsp.read(false)
89
- packet.buffer.length.should eql 3
89
+ expect(packet.buffer.length).to eql 3
90
90
  end
91
91
  end
92
92
 
93
93
  describe "write" do
94
- it "should work without a response" do
94
+ it "works without a response" do
95
95
  $buffer = ''
96
96
  class MyStream1 < Stream
97
97
  def connect; end
@@ -109,10 +109,10 @@ module Cosmos
109
109
  packet.restore_defaults
110
110
  tsp.connect(MyStream1.new)
111
111
  tsp.write(packet)
112
- $buffer.should eq "SOUR:VOLT 1, (@2)\xAB\xCD"
112
+ expect($buffer).to eq "SOUR:VOLT 1, (@2)\xAB\xCD"
113
113
  end
114
114
 
115
- it "should process responses" do
115
+ it "processes responses" do
116
116
  $buffer = ''
117
117
  $read_cnt = 0
118
118
  class MyStream2 < Stream
@@ -145,9 +145,9 @@ module Cosmos
145
145
  packet.restore_defaults
146
146
  tsp.connect(MyStream2.new)
147
147
  tsp.write(packet)
148
- $buffer.should eq "SOUR:VOLT 10, (@20)\xAB\xCD"
148
+ expect($buffer).to eq "SOUR:VOLT 10, (@20)\xAB\xCD"
149
149
  pkt = tsp.read()
150
- pkt.read("VOLTAGE").should eq 10
150
+ expect(pkt.read("VOLTAGE")).to eq 10
151
151
  end
152
152
  end
153
153
 
@@ -17,20 +17,20 @@ module Cosmos
17
17
 
18
18
  describe TerminatedStreamProtocol do
19
19
  describe "initialize" do
20
- it "should initialize attributes" do
20
+ it "initializes attributes" do
21
21
  tsp = TerminatedStreamProtocol.new('0xABCD','0xABCD')
22
- tsp.bytes_read.should eql 0
23
- tsp.bytes_written.should eql 0
24
- tsp.interface.should be_nil
25
- tsp.stream.should be_nil
26
- tsp.post_read_data_callback.should be_nil
27
- tsp.post_read_packet_callback.should be_nil
28
- tsp.pre_write_packet_callback.should be_nil
22
+ expect(tsp.bytes_read).to eql 0
23
+ expect(tsp.bytes_written).to eql 0
24
+ expect(tsp.interface).to be_nil
25
+ expect(tsp.stream).to be_nil
26
+ expect(tsp.post_read_data_callback).to be_nil
27
+ expect(tsp.post_read_packet_callback).to be_nil
28
+ expect(tsp.pre_write_packet_callback).to be_nil
29
29
  end
30
30
  end
31
31
 
32
32
  describe "read" do
33
- it "should read packets from the stream" do
33
+ it "reads packets from the stream" do
34
34
  class MyStream < Stream
35
35
  def connect; end
36
36
  def connected?; true; end
@@ -53,10 +53,10 @@ module Cosmos
53
53
  $buffer1 = "\x00\x01\x02\xAB"
54
54
  $buffer2 = "\xCD\x44\x02\x03"
55
55
  packet = lsp.read
56
- packet.buffer.length.should eql 3
56
+ expect(packet.buffer.length).to eql 3
57
57
  end
58
58
 
59
- it "should keep the the termination characters" do
59
+ it "keeps the the termination characters" do
60
60
  class MyStream < Stream
61
61
  def connect; end
62
62
  def connected?; true; end
@@ -79,14 +79,14 @@ module Cosmos
79
79
  $buffer1 = "\x00\x01\x02\xAB"
80
80
  $buffer2 = "\xCD\x44\x02\x03"
81
81
  packet = lsp.read
82
- packet.buffer.length.should eql 5
83
- packet.buffer[-2].unpack('C')[0].should eql 0xAB
84
- packet.buffer[-1].unpack('C')[0].should eql 0xCD
82
+ expect(packet.buffer.length).to eql 5
83
+ expect(packet.buffer[-2].unpack('C')[0]).to eql 0xAB
84
+ expect(packet.buffer[-1].unpack('C')[0]).to eql 0xCD
85
85
  end
86
86
  end
87
87
 
88
88
  describe "write" do
89
- it "should append termination characters to the packet" do
89
+ it "appends termination characters to the packet" do
90
90
  class MyStream < Stream
91
91
  def connect; end
92
92
  def connected?; true; end
@@ -100,12 +100,12 @@ module Cosmos
100
100
  pkt = Packet.new('tgt','pkt')
101
101
  pkt.buffer = "\x00\x01\x02\x03"
102
102
  packet = lsp.write(pkt)
103
- $buffer.length.should eql 6
104
- $buffer[-2].unpack('C')[0].should eql 0xCD
105
- $buffer[-1].unpack('C')[0].should eql 0xEF
103
+ expect($buffer.length).to eql 6
104
+ expect($buffer[-2].unpack('C')[0]).to eql 0xCD
105
+ expect($buffer[-1].unpack('C')[0]).to eql 0xEF
106
106
  end
107
107
 
108
- it "should complain if the packet buffer contains the termination characters" do
108
+ it "complains if the packet buffer contains the termination characters" do
109
109
  class MyStream < Stream
110
110
  def connect; end
111
111
  def connected?; true; end
@@ -41,43 +41,43 @@ module Cosmos
41
41
  end
42
42
 
43
43
  describe "instance" do
44
- it "should create default ports" do
44
+ it "creates default ports" do
45
45
  # Don't check the actual port numbers but just that they exist
46
- System.ports.keys.should eql %w(CTS_API TLMVIEWER_API CTS_PREIDENTIFIED)
46
+ expect(System.ports.keys).to eql %w(CTS_API TLMVIEWER_API CTS_PREIDENTIFIED)
47
47
  end
48
48
 
49
- it "should create default paths" do
49
+ it "creates default paths" do
50
50
  # Don't check the actual paths but just that they exist
51
- System.paths.keys.should eql %w(LOGS TMP SAVED_CONFIG TABLES HANDBOOKS PROCEDURES)
51
+ expect(System.paths.keys).to eql %w(LOGS TMP SAVED_CONFIG TABLES HANDBOOKS PROCEDURES)
52
52
  end
53
53
  end
54
54
 
55
55
  describe "System.commands" do
56
- it "should only contain UNKNOWN" do
57
- System.commands.target_names.should eql ["UNKNOWN"]
56
+ it "is empty" do
57
+ expect(System.commands.target_names).to eql []
58
58
  end
59
59
 
60
- it "should log errors saving the configuration" do
60
+ it "logs errors saving the configuration" do
61
61
  # Force a reload of the configuration
62
62
  System.class_eval('@@instance = nil')
63
63
 
64
64
  capture_io do |stdout|
65
65
  allow(FileUtils).to receive(:mkdir_p) { raise "Error" }
66
- System.commands.target_names.should eql ["UNKNOWN"]
67
- stdout.string.should match "Problem saving configuration"
66
+ expect(System.commands.target_names).to eql []
67
+ expect(stdout.string).to match "Problem saving configuration"
68
68
  end
69
69
  end
70
70
  end
71
71
 
72
72
  describe "System.telemetry" do
73
- it "should only contain UNKNOWN" do
74
- System.telemetry.target_names.should eql ["UNKNOWN"]
73
+ it "is empty" do
74
+ expect(System.telemetry.target_names).to eql []
75
75
  end
76
76
  end
77
77
 
78
78
  describe "System.limits" do
79
- it "should include the DEFAULT limit set" do
80
- System.limits.sets.should include :DEFAULT
79
+ it "includes the DEFAULT limit set" do
80
+ expect(System.limits.sets).to include :DEFAULT
81
81
  end
82
82
  end
83
83
 
@@ -88,7 +88,7 @@ module Cosmos
88
88
  end
89
89
 
90
90
  describe "System.clear_counters" do
91
- it "should clear the target, command and telemetry counters" do
91
+ it "clears the target, command and telemetry counters" do
92
92
  System.targets.each do |name, tgt|
93
93
  tgt.cmd_cnt = 100
94
94
  tgt.tlm_cnt = 100
@@ -103,46 +103,46 @@ module Cosmos
103
103
  System.clear_counters
104
104
 
105
105
  System.targets.each do |name, tgt|
106
- tgt.cmd_cnt.should eql 0
107
- tgt.tlm_cnt.should eql 0
106
+ expect(tgt.cmd_cnt).to eql 0
107
+ expect(tgt.tlm_cnt).to eql 0
108
108
  end
109
109
  System.commands.all do |tgt, pkt|
110
- pkt.received_count.should eql 0
110
+ expect(pkt.received_count).to eql 0
111
111
  end
112
112
  System.telemetry.all do |tgt, pkt|
113
- pkt.received_count.should eql 0
113
+ expect(pkt.received_count).to eql 0
114
114
  end
115
115
  end
116
116
  end
117
117
 
118
118
  describe "packets and System.packets" do
119
- it "should calculate MD5s across all the target files" do
119
+ it "calculates MD5s across all the target files" do
120
120
  capture_io do |stdout|
121
121
  # This line actually does the work of reading the configuration
122
- System.telemetry.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
123
- System.commands.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
122
+ expect(System.telemetry.target_names).to eql ['COSMOS','INST','META']
123
+ expect(System.commands.target_names).to eql ['COSMOS','INST','META']
124
124
 
125
- stdout.string.should match "Marshal file does not exist"
125
+ expect(stdout.string).to match "Marshal file does not exist"
126
126
 
127
127
  # Reset stdout for another go at the processing
128
128
  stdout.rewind
129
129
  # Reset the instance variable so it will read the new configuration
130
130
  System.class_eval('@@instance = nil')
131
131
  # This line actually does the work of reading the configuration
132
- System.telemetry.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
133
- System.commands.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
132
+ expect(System.telemetry.target_names).to eql ['COSMOS','INST','META']
133
+ expect(System.commands.target_names).to eql ['COSMOS','INST','META']
134
134
 
135
- stdout.string.should match "Marshal load success"
135
+ expect(stdout.string).to match "Marshal load success"
136
136
  end
137
137
  end
138
138
 
139
- it "should handle target parsing errors" do
139
+ it "handles target parsing errors" do
140
140
  capture_io do |stdout|
141
141
  allow_any_instance_of(PacketConfig).to receive(:process_file) { raise "ProcessError" }
142
142
  # This line actually does the work of reading the configuration
143
- expect { System.telemetry.target_names.should eql ['COSMOS','INST','META','UNKNOWN'] }.to raise_error("ProcessError")
143
+ expect { System.telemetry.target_names }.to raise_error("ProcessError")
144
144
 
145
- stdout.string.should match "Problem processing"
145
+ expect(stdout.string).to match "Problem processing"
146
146
  end
147
147
  end
148
148
  end
@@ -153,13 +153,13 @@ module Cosmos
153
153
  File.delete(File.join(@config_targets,'COSMOS','cmd_tlm','test2_tlm.txt'))
154
154
  end
155
155
 
156
- it "should load the initial configuration" do
156
+ it "loads the initial configuration" do
157
157
  System.load_configuration
158
- System.commands.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
159
- System.telemetry.target_names.should eql ['COSMOS','INST','META','UNKNOWN']
158
+ expect(System.commands.target_names).to eql ['COSMOS','INST','META']
159
+ expect(System.telemetry.target_names).to eql ['COSMOS','INST','META']
160
160
  end
161
161
 
162
- it "should load a named configuration" do
162
+ it "loads a named configuration" do
163
163
  File.open(@config_file,'w') do |file|
164
164
  file.puts "DECLARE_TARGET COSMOS"
165
165
  file.puts "DECLARE_TARGET COSMOS OVERRIDE"
@@ -167,7 +167,7 @@ module Cosmos
167
167
 
168
168
  # Load the original configuration
169
169
  original_config_name = System.load_configuration()
170
- System.telemetry.target_names.should eql %w(COSMOS OVERRIDE UNKNOWN)
170
+ expect(System.telemetry.target_names).to eql %w(COSMOS OVERRIDE)
171
171
  original_pkts = System.telemetry.packets('COSMOS').keys
172
172
 
173
173
  # Create a new configuration by writing another telemetry file
@@ -177,13 +177,13 @@ module Cosmos
177
177
  end
178
178
  System.instance.process_file(@config_file)
179
179
  # Verify the new telemetry packet is there
180
- System.telemetry.packets('COSMOS').keys.should include "TEST1"
180
+ expect(System.telemetry.packets('COSMOS').keys).to include "TEST1"
181
181
  second_config_name = System.configuration_name
182
182
 
183
183
  # Now load the original configuration
184
184
  name = System.load_configuration(original_config_name)
185
- original_config_name.should eql name
186
- System.telemetry.packets('COSMOS').keys.should_not include "TEST1"
185
+ expect(original_config_name).to eql name
186
+ expect(System.telemetry.packets('COSMOS').keys).not_to include "TEST1"
187
187
 
188
188
  # Create yet another configuration by writing another telemetry file
189
189
  File.open(File.join(@config_targets,'COSMOS','cmd_tlm','test2_tlm.txt'),'w') do |file|
@@ -193,19 +193,19 @@ module Cosmos
193
193
  System.instance.process_file(@config_file)
194
194
  names = []
195
195
  # Verify the new telemetry packet is there as well as the second one
196
- System.telemetry.packets('COSMOS').keys.should include("TEST1", "TEST2")
196
+ expect(System.telemetry.packets('COSMOS').keys).to include("TEST1", "TEST2")
197
197
  third_config_name = System.configuration_name
198
198
 
199
199
  # Try loading something that doesn't exist
200
200
  # It should fail and reload the original configuration
201
201
  name = System.load_configuration("BLAH")
202
- name.should eql original_config_name
202
+ expect(name).to eql original_config_name
203
203
 
204
204
  # Now load the second configuration. It shouldn't have the most
205
205
  # recently defined telemetry packet.
206
206
  System.load_configuration(second_config_name)
207
- System.telemetry.packets('COSMOS').keys.should include "TEST1"
208
- System.telemetry.packets('COSMOS').keys.should_not include "TEST2"
207
+ expect(System.telemetry.packets('COSMOS').keys).to include "TEST1"
208
+ expect(System.telemetry.packets('COSMOS').keys).not_to include "TEST2"
209
209
  end
210
210
  end
211
211
  end
@@ -228,7 +228,7 @@ module Cosmos
228
228
  FileUtils.mv File.join(Cosmos::USERPATH, 'targets'), File.join(Cosmos::USERPATH, 'config')
229
229
  end
230
230
 
231
- it "should complain about unknown keywords" do
231
+ it "complains about unknown keywords" do
232
232
  tf = Tempfile.new('unittest')
233
233
  tf.puts("BLAH")
234
234
  tf.close
@@ -237,7 +237,7 @@ module Cosmos
237
237
  end
238
238
 
239
239
  context "with AUTO_DECLARE_TARGETS" do
240
- it "should take 0 parameters" do
240
+ it "takes 0 parameters" do
241
241
  tf = Tempfile.new('unittest')
242
242
  tf.puts("AUTO_DECLARE_TARGETS TRUE")
243
243
  tf.close
@@ -245,7 +245,7 @@ module Cosmos
245
245
  tf.unlink
246
246
  end
247
247
 
248
- it "should complain if config/targets doesn't exist" do
248
+ it "complains if config/targets doesn't exist" do
249
249
  tf = Tempfile.new('unittest')
250
250
  tf.puts("AUTO_DECLARE_TARGETS")
251
251
  tf.close
@@ -255,7 +255,7 @@ module Cosmos
255
255
  tf.unlink
256
256
  end
257
257
 
258
- it "should complain if target directories aren't uppercase" do
258
+ it "complains if target directories aren't uppercase" do
259
259
  tf = Tempfile.new('unittest')
260
260
  tf.puts("AUTO_DECLARE_TARGETS")
261
261
  tf.close
@@ -265,7 +265,7 @@ module Cosmos
265
265
  tf.unlink
266
266
  end
267
267
 
268
- it "should process target directories with the SYSTEM directory last" do
268
+ it "processes target directories with the SYSTEM directory last" do
269
269
  tf = Tempfile.new('unittest')
270
270
  tf.puts("AUTO_DECLARE_TARGETS")
271
271
  tf.close
@@ -275,7 +275,7 @@ module Cosmos
275
275
  System.instance.process_file(tf.path)
276
276
  # Since Ruby 1.9+ uses ordered Hashes we can ask for the keys and
277
277
  # SYSTEM should be last
278
- System.instance.targets.keys.should eql %w(ABC XYZ SYSTEM)
278
+ expect(System.instance.targets.keys).to eql %w(ABC XYZ SYSTEM)
279
279
  Dir.rmdir(File.join(@config_targets, 'ABC'))
280
280
  Dir.rmdir(File.join(@config_targets, 'SYSTEM'))
281
281
  Dir.rmdir(File.join(@config_targets, 'XYZ'))
@@ -284,7 +284,7 @@ module Cosmos
284
284
  end
285
285
 
286
286
  context "with DECLARE_TARGET" do
287
- it "should take 1 or 2 parameters" do
287
+ it "takes 1 or 2 parameters" do
288
288
  tf = Tempfile.new('unittest')
289
289
  tf.puts("DECLARE_TARGET")
290
290
  tf.close
@@ -298,7 +298,7 @@ module Cosmos
298
298
  tf.unlink
299
299
  end
300
300
 
301
- it "should complain if the target directory doesn't exist" do
301
+ it "complains if the target directory doesn't exist" do
302
302
  tf = Tempfile.new('unittest')
303
303
  tf.puts("DECLARE_TARGET TGT")
304
304
  tf.close
@@ -306,7 +306,7 @@ module Cosmos
306
306
  tf.unlink
307
307
  end
308
308
 
309
- it "should process the target directory" do
309
+ it "processes the target directory" do
310
310
  tf = Tempfile.new('unittest')
311
311
  tf.puts("DECLARE_TARGET TGT")
312
312
  tf.close
@@ -315,7 +315,7 @@ module Cosmos
315
315
  tf.unlink
316
316
  end
317
317
 
318
- it "should process the target directory with substitute name" do
318
+ it "processes the target directory with substitute name" do
319
319
  tf = Tempfile.new('unittest')
320
320
  tf.puts("DECLARE_TARGET TGT NEW")
321
321
  tf.close
@@ -324,7 +324,7 @@ module Cosmos
324
324
  tf.unlink
325
325
  end
326
326
 
327
- it "should process the target directory with specified target.txt" do
327
+ it "processes the target directory with specified target.txt" do
328
328
  tf = Tempfile.new('unittest')
329
329
  tf.puts("DECLARE_TARGET TGT nil target.txt")
330
330
  tf.close
@@ -338,7 +338,7 @@ module Cosmos
338
338
  end
339
339
 
340
340
  context "with PORT" do
341
- it "should take 2 parameters" do
341
+ it "takes 2 parameters" do
342
342
  tf = Tempfile.new('unittest')
343
343
  tf.puts("PORT CTS_API")
344
344
  tf.close
@@ -352,30 +352,30 @@ module Cosmos
352
352
  tf.unlink
353
353
  end
354
354
 
355
- it "should complain about unknown ports" do
355
+ it "complains about unknown ports" do
356
356
  tf = Tempfile.new('unittest')
357
357
  tf.puts("PORT MYPORT 10")
358
358
  tf.close
359
359
  capture_io do |stdout|
360
360
  System.instance.process_file(tf.path)
361
- stdout.string.should match /WARN: Unknown port name given: MYPORT/
361
+ expect(stdout.string).to match /WARN: Unknown port name given: MYPORT/
362
362
  end
363
363
  tf.unlink
364
364
  end
365
365
 
366
- it "should change known ports" do
366
+ it "changes known ports" do
367
367
  tf = Tempfile.new('unittest')
368
368
  tf.puts("PORT CTS_API 8888")
369
369
  tf.close
370
- System.ports['CTS_API'].should eql 7777
370
+ expect(System.ports['CTS_API']).to eql 7777
371
371
  System.instance.process_file(tf.path)
372
- System.ports['CTS_API'].should eql 8888
372
+ expect(System.ports['CTS_API']).to eql 8888
373
373
  tf.unlink
374
374
  end
375
375
  end
376
376
 
377
377
  context "with PATH" do
378
- it "should take 2 parameters" do
378
+ it "takes 2 parameters" do
379
379
  tf = Tempfile.new('unittest')
380
380
  tf.puts("PATH C:/")
381
381
  tf.close
@@ -389,32 +389,32 @@ module Cosmos
389
389
  tf.unlink
390
390
  end
391
391
 
392
- it "should complain about unknown paths" do
392
+ it "complains about unknown paths" do
393
393
  tf = Tempfile.new('unittest')
394
394
  tf.puts("PATH MYPATH C:/")
395
395
  tf.close
396
396
  capture_io do |stdout|
397
397
  System.instance.process_file(tf.path)
398
- stdout.string.should match /WARN: Unknown path name given: MYPATH/
398
+ expect(stdout.string).to match /WARN: Unknown path name given: MYPATH/
399
399
  end
400
400
  tf.unlink
401
401
  end
402
402
 
403
- it "should change known paths" do
403
+ it "changes known paths" do
404
404
  if Kernel.is_windows?
405
405
  tf = Tempfile.new('unittest')
406
406
  tf.puts("PATH LOGS C:/mylogs")
407
407
  tf.close
408
- System.paths['LOGS'].should match 'outputs/logs'
408
+ expect(System.paths['LOGS']).to match 'outputs/logs'
409
409
  System.instance.process_file(tf.path)
410
- System.paths['LOGS'].should eql 'C:/mylogs'
410
+ expect(System.paths['LOGS']).to eql 'C:/mylogs'
411
411
  tf.unlink
412
412
  end
413
413
  end
414
414
  end
415
415
 
416
416
  context "with DEFAULT_PACKET_LOG_WRITER" do
417
- it "should take 1 parameters" do
417
+ it "takes 1 parameters" do
418
418
  tf = Tempfile.new('unittest')
419
419
  tf.puts("DEFAULT_PACKET_LOG_WRITER")
420
420
  tf.close
@@ -428,7 +428,7 @@ module Cosmos
428
428
  tf.unlink
429
429
  end
430
430
 
431
- it "should complain if the class doesn't exist" do
431
+ it "complains if the class doesn't exist" do
432
432
  tf = Tempfile.new('unittest')
433
433
  tf.puts("DEFAULT_PACKET_LOG_WRITER my_nonexistent_class")
434
434
  tf.close
@@ -436,7 +436,7 @@ module Cosmos
436
436
  tf.unlink
437
437
  end
438
438
 
439
- it "should set the packet writer" do
439
+ it "sets the packet writer" do
440
440
  filename = File.join(File.dirname(__FILE__),'..','..','lib','my_writer.rb')
441
441
  File.open(filename, 'w') do |file|
442
442
  file.puts "class MyWriter"
@@ -446,14 +446,14 @@ module Cosmos
446
446
  tf.puts("DEFAULT_PACKET_LOG_WRITER my_writer")
447
447
  tf.close
448
448
  System.instance.process_file(tf.path)
449
- System.default_packet_log_writer.should eql MyWriter
449
+ expect(System.default_packet_log_writer).to eql MyWriter
450
450
  File.delete filename
451
451
  tf.unlink
452
452
  end
453
453
  end
454
454
 
455
455
  context "with DEFAULT_PACKET_LOG_READER" do
456
- it "should take 1 parameters" do
456
+ it "takes 1 parameters" do
457
457
  tf = Tempfile.new('unittest')
458
458
  tf.puts("DEFAULT_PACKET_LOG_READER")
459
459
  tf.close
@@ -467,7 +467,7 @@ module Cosmos
467
467
  tf.unlink
468
468
  end
469
469
 
470
- it "should complain if the class doesn't exist" do
470
+ it "complains if the class doesn't exist" do
471
471
  tf = Tempfile.new('unittest')
472
472
  tf.puts("DEFAULT_PACKET_LOG_READER my_nonexistent_class")
473
473
  tf.close
@@ -475,7 +475,7 @@ module Cosmos
475
475
  tf.unlink
476
476
  end
477
477
 
478
- it "should set the packet reader" do
478
+ it "sets the packet reader" do
479
479
  filename = File.join(File.dirname(__FILE__),'..','..','lib','my_reader.rb')
480
480
  File.open(filename, 'w') do |file|
481
481
  file.puts "class MyReader"
@@ -485,14 +485,14 @@ module Cosmos
485
485
  tf.puts("DEFAULT_PACKET_LOG_READER my_reader")
486
486
  tf.close
487
487
  System.instance.process_file(tf.path)
488
- System.default_packet_log_reader.should eql MyReader
488
+ expect(System.default_packet_log_reader).to eql MyReader
489
489
  File.delete filename
490
490
  tf.unlink
491
491
  end
492
492
  end
493
493
 
494
494
  context "with DISABLE_DNS" do
495
- it "should take 0 parameters" do
495
+ it "takes 0 parameters" do
496
496
  tf = Tempfile.new('unittest')
497
497
  tf.puts("DISABLE_DNS BLAH TRUE")
498
498
  tf.close
@@ -500,19 +500,19 @@ module Cosmos
500
500
  tf.unlink
501
501
  end
502
502
 
503
- it "should disable dns lookups" do
503
+ it "disables dns lookups" do
504
504
  tf = Tempfile.new('unittest')
505
505
  tf.puts("DISABLE_DNS")
506
506
  tf.close
507
- System.use_dns.should be_truthy
507
+ expect(System.use_dns).to be_truthy
508
508
  System.instance.process_file(tf.path)
509
- System.use_dns.should be_falsey
509
+ expect(System.use_dns).to be_falsey
510
510
  tf.unlink
511
511
  end
512
512
  end
513
513
 
514
514
  context "with ALLOW_ACCESS" do
515
- it "should take 1 parameters" do
515
+ it "takes 1 parameters" do
516
516
  tf = Tempfile.new('unittest')
517
517
  tf.puts("ALLOW_ACCESS")
518
518
  tf.close
@@ -526,7 +526,7 @@ module Cosmos
526
526
  tf.unlink
527
527
  end
528
528
 
529
- it "should complain about bad addresses" do
529
+ it "complains about bad addresses" do
530
530
  tf = Tempfile.new('unittest')
531
531
  tf.puts("ALLOW_ACCESS blah")
532
532
  tf.close
@@ -540,39 +540,39 @@ module Cosmos
540
540
  tf.unlink
541
541
  end
542
542
 
543
- it "should allow ALL" do
543
+ it "allows ALL" do
544
544
  tf = Tempfile.new('unittest')
545
545
  tf.puts("ALLOW_ACCESS ALL")
546
546
  tf.close
547
547
  System.instance.process_file(tf.path)
548
- System.acl.should be_nil
548
+ expect(System.acl).to be_nil
549
549
  tf.unlink
550
550
  end
551
551
 
552
- it "should store host by name" do
552
+ it "stores host by name" do
553
553
  tf = Tempfile.new('unittest')
554
554
  tf.puts("ALLOW_ACCESS localhost")
555
555
  tf.close
556
556
  System.instance.process_file(tf.path)
557
- System.acl.allow_addr?(["AF_INET",0,"localhost","127.0.0.1"]).should be_truthy
557
+ expect(System.acl.allow_addr?(["AF_INET",0,"localhost","127.0.0.1"])).to be_truthy
558
558
  tf.unlink
559
559
  end
560
560
 
561
- it "should store host by IP address" do
561
+ it "stores host by IP address" do
562
562
  addr = IPSocket.getaddress("www.google.com")
563
563
  if addr and !addr.index(':')
564
564
  tf = Tempfile.new('unittest')
565
565
  tf.puts("ALLOW_ACCESS #{addr}")
566
566
  tf.close
567
567
  System.instance.process_file(tf.path)
568
- System.acl.allow_addr?(["AF_INET",0,"www.google.com",addr]).should be_truthy
568
+ expect(System.acl.allow_addr?(["AF_INET",0,"www.google.com",addr])).to be_truthy
569
569
  tf.unlink
570
570
  end
571
571
  end
572
572
  end
573
573
 
574
574
  context "with STALENESS_SECONDS" do
575
- it "should take 1 parameters" do
575
+ it "takes 1 parameters" do
576
576
  tf = Tempfile.new('unittest')
577
577
  tf.puts("STALENESS_SECONDS")
578
578
  tf.close
@@ -586,19 +586,19 @@ module Cosmos
586
586
  tf.unlink
587
587
  end
588
588
 
589
- it "should set the number of seconds required to be stale" do
589
+ it "sets the number of seconds required to be stale" do
590
590
  tf = Tempfile.new('unittest')
591
591
  tf.puts("STALENESS_SECONDS 3")
592
592
  tf.close
593
- System.staleness_seconds.should eql 30
593
+ expect(System.staleness_seconds).to eql 30
594
594
  System.instance.process_file(tf.path)
595
- System.staleness_seconds.should eql 3
595
+ expect(System.staleness_seconds).to eql 3
596
596
  tf.unlink
597
597
  end
598
598
  end
599
599
 
600
600
  context "with CMD_TLM_VERSION" do
601
- it "should take 1 parameters" do
601
+ it "takes 1 parameters" do
602
602
  tf = Tempfile.new('unittest')
603
603
  tf.puts("CMD_TLM_VERSION")
604
604
  tf.close
@@ -612,31 +612,31 @@ module Cosmos
612
612
  tf.unlink
613
613
  end
614
614
 
615
- it "should set the command and telemetry version" do
615
+ it "sets the command and telemetry version" do
616
616
  tf = Tempfile.new('unittest')
617
617
  tf.puts("CMD_TLM_VERSION 2.1")
618
618
  tf.close
619
- System.cmd_tlm_version.should be_nil
619
+ expect(System.cmd_tlm_version).to be_nil
620
620
  System.instance.process_file(tf.path)
621
- System.cmd_tlm_version.should eql "2.1"
621
+ expect(System.cmd_tlm_version).to eql "2.1"
622
622
  tf.unlink
623
623
  end
624
624
  end
625
625
  end
626
626
 
627
627
  describe "Cosmos.write_exception_file" do
628
- it "should write a file with the exception" do
628
+ it "writes a file with the exception" do
629
629
  filename = Cosmos.write_exception_file(RuntimeError.new("HELP!"))
630
- File.exist?(filename).should be_truthy
630
+ expect(File.exist?(filename)).to be_truthy
631
631
  File.delete(filename)
632
632
  end
633
633
 
634
- it "should write a file without a defined LOGS directory" do
634
+ it "writes a file without a defined LOGS directory" do
635
635
  File.open(@config_file,'w') {|file| file.puts "PATH LOGS C:/this/is/not/a/real/path" }
636
636
  # Reset the instance variable so it will read the new config file
637
637
  System.instance_eval('@instance = nil')
638
638
  filename = Cosmos.write_exception_file(RuntimeError.new("HELP!"))
639
- File.exist?(filename).should be_truthy
639
+ expect(File.exist?(filename)).to be_truthy
640
640
  File.delete(filename)
641
641
  end
642
642
  end