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
@@ -18,8 +18,8 @@ module Cosmos
18
18
  describe Commands do
19
19
 
20
20
  describe "initialize" do
21
- it "should have no warnings" do
22
- Commands.new(PacketConfig.new).warnings.should be_empty
21
+ it "has no warnings" do
22
+ expect(Commands.new(PacketConfig.new).warnings).to be_empty
23
23
  end
24
24
  end
25
25
 
@@ -60,307 +60,307 @@ module Cosmos
60
60
  end
61
61
 
62
62
  describe "target_names" do
63
- it "should return an array with just UNKNOWN if no targets" do
64
- Commands.new(PacketConfig.new).target_names.should eql ["UNKNOWN"]
63
+ it "returns an empty array if no targets" do
64
+ expect(Commands.new(PacketConfig.new).target_names).to eql []
65
65
  end
66
66
 
67
- it "should return all target names" do
68
- @cmd.target_names.should eql ["TGT1","TGT2","UNKNOWN"]
67
+ it "returns all target names" do
68
+ expect(@cmd.target_names).to eql ["TGT1","TGT2"]
69
69
  end
70
70
  end
71
71
 
72
72
  describe "packets" do
73
- it "should complain about non-existant targets" do
73
+ it "complains about non-existant targets" do
74
74
  expect { @cmd.packets("tgtX") }.to raise_error(RuntimeError, "Command target 'TGTX' does not exist")
75
75
  end
76
76
 
77
- it "should return all packets target TGT1" do
77
+ it "returns all packets target TGT1" do
78
78
  pkts = @cmd.packets("TGT1")
79
- pkts.length.should eql 2
80
- pkts.keys.should include("PKT1")
81
- pkts.keys.should include("PKT2")
79
+ expect(pkts.length).to eql 2
80
+ expect(pkts.keys).to include("PKT1")
81
+ expect(pkts.keys).to include("PKT2")
82
82
  end
83
83
 
84
- it "should return all packets target TGT2" do
84
+ it "returns all packets target TGT2" do
85
85
  pkts = @cmd.packets("TGT2")
86
- pkts.length.should eql 3
87
- pkts.keys.should include("PKT3")
88
- pkts.keys.should include("PKT4")
89
- pkts.keys.should include("PKT5")
86
+ expect(pkts.length).to eql 3
87
+ expect(pkts.keys).to include("PKT3")
88
+ expect(pkts.keys).to include("PKT4")
89
+ expect(pkts.keys).to include("PKT5")
90
90
  end
91
91
  end
92
92
 
93
93
  describe "params" do
94
- it "should complain about non-existant targets" do
94
+ it "complains about non-existant targets" do
95
95
  expect { @cmd.params("TGTX","PKT1") }.to raise_error(RuntimeError, "Command target 'TGTX' does not exist")
96
96
  end
97
97
 
98
- it "should complain about non-existant packets" do
98
+ it "complains about non-existant packets" do
99
99
  expect { @cmd.params("TGT1","PKTX") }.to raise_error(RuntimeError, "Command packet 'TGT1 PKTX' does not exist")
100
100
  end
101
101
 
102
- it "should return all items from packet TGT1/PKT1" do
102
+ it "returns all items from packet TGT1/PKT1" do
103
103
  items = @cmd.params("TGT1","PKT1")
104
- items.length.should eql 4
105
- items[0].name.should eql "ITEM1"
106
- items[1].name.should eql "ITEM2"
107
- items[2].name.should eql "ITEM3"
108
- items[3].name.should eql "ITEM4"
104
+ expect(items.length).to eql 4
105
+ expect(items[0].name).to eql "ITEM1"
106
+ expect(items[1].name).to eql "ITEM2"
107
+ expect(items[2].name).to eql "ITEM3"
108
+ expect(items[3].name).to eql "ITEM4"
109
109
  end
110
110
  end
111
111
 
112
112
  describe "packet" do
113
- it "should complain about non-existant targets" do
113
+ it "complains about non-existant targets" do
114
114
  expect { @cmd.packet("tgtX","pkt1") }.to raise_error(RuntimeError, "Command target 'TGTX' does not exist")
115
115
  end
116
116
 
117
- it "should complain about non-existant packets" do
117
+ it "complains about non-existant packets" do
118
118
  expect { @cmd.packet("TGT1","PKTX") }.to raise_error(RuntimeError, "Command packet 'TGT1 PKTX' does not exist")
119
119
  end
120
120
 
121
- it "should return the specified packet" do
121
+ it "returns the specified packet" do
122
122
  pkt = @cmd.packet("TGT1","PKT1")
123
- pkt.target_name.should eql "TGT1"
124
- pkt.packet_name.should eql "PKT1"
123
+ expect(pkt.target_name).to eql "TGT1"
124
+ expect(pkt.packet_name).to eql "PKT1"
125
125
  end
126
126
  end
127
127
 
128
128
  describe "identify" do
129
129
  it "return nil with a nil buffer" do
130
- @cmd.identify(nil).should be_nil
130
+ expect(@cmd.identify(nil)).to be_nil
131
131
  end
132
132
 
133
- it "should only check the targets given" do
133
+ it "only checks the targets given" do
134
134
  buffer = "\x01\x02\x03\x04"
135
135
  pkt = @cmd.identify(buffer,["TGT1"])
136
136
  pkt.enable_method_missing
137
- pkt.item1.should eql 1
138
- pkt.item2.should eql 2
139
- pkt.item3.should eql 3
140
- pkt.item4.should eql 4
137
+ expect(pkt.item1).to eql 1
138
+ expect(pkt.item2).to eql 2
139
+ expect(pkt.item3).to eql 3
140
+ expect(pkt.item4).to eql 4
141
141
  end
142
142
 
143
- it "should return nil with unknown targets given" do
143
+ it "returns nil with unknown targets given" do
144
144
  buffer = "\x01\x02\x03\x04"
145
- @cmd.identify(buffer,["TGTX"]).should be_nil
145
+ expect(@cmd.identify(buffer,["TGTX"])).to be_nil
146
146
  end
147
147
 
148
148
  context "with an unknown buffer" do
149
- it "should log an invalid sized buffer" do
149
+ it "logs an invalid sized buffer" do
150
150
  capture_io do |stdout|
151
151
  buffer = "\x01\x02\x03"
152
152
  pkt = @cmd.identify(buffer)
153
153
  pkt.enable_method_missing
154
- pkt.item1.should eql 1
155
- pkt.item2.should eql 2
156
- pkt.item3.should eql 3
157
- pkt.item4.should eql 0
158
- stdout.string.should match(/ERROR: TGT1 PKT1 received with actual packet length of 3 but defined length of 4/)
154
+ expect(pkt.item1).to eql 1
155
+ expect(pkt.item2).to eql 2
156
+ expect(pkt.item3).to eql 3
157
+ expect(pkt.item4).to eql 0
158
+ expect(stdout.string).to match(/ERROR: TGT1 PKT1 received with actual packet length of 3 but defined length of 4/)
159
159
  end
160
160
  end
161
161
 
162
- it "should log an invalid sized buffer" do
162
+ it "logs an invalid sized buffer" do
163
163
  capture_io do |stdout|
164
164
  buffer = "\x01\x02\x03\x04\x05"
165
165
  pkt = @cmd.identify(buffer)
166
166
  pkt.enable_method_missing
167
- pkt.item1.should eql 1
168
- pkt.item2.should eql 2
169
- pkt.item3.should eql 3
170
- pkt.item4.should eql 4
171
- stdout.string.should match(/ERROR: TGT1 PKT1 received with actual packet length of 5 but defined length of 4/)
167
+ expect(pkt.item1).to eql 1
168
+ expect(pkt.item2).to eql 2
169
+ expect(pkt.item3).to eql 3
170
+ expect(pkt.item4).to eql 4
171
+ expect(stdout.string).to match(/ERROR: TGT1 PKT1 received with actual packet length of 5 but defined length of 4/)
172
172
  end
173
173
  end
174
174
 
175
- it "should identify TGT1 PKT1 but not affect the latest data table" do
175
+ it "identifies TGT1 PKT1 but not affect the latest data table" do
176
176
  buffer = "\x01\x02\x03\x04"
177
177
  pkt = @cmd.identify(buffer)
178
178
  pkt.enable_method_missing
179
- pkt.item1.should eql 1
180
- pkt.item2.should eql 2
181
- pkt.item3.should eql 3
182
- pkt.item4.should eql 4
179
+ expect(pkt.item1).to eql 1
180
+ expect(pkt.item2).to eql 2
181
+ expect(pkt.item3).to eql 3
182
+ expect(pkt.item4).to eql 4
183
183
 
184
184
  # Now request the packet from the latest data table
185
185
  pkt = @cmd.packet("TGT1","PKT1")
186
186
  pkt.enable_method_missing
187
- pkt.item1.should eql 0
188
- pkt.item2.should eql 0
189
- pkt.item3.should eql 0
190
- pkt.item4.should eql 0
187
+ expect(pkt.item1).to eql 0
188
+ expect(pkt.item2).to eql 0
189
+ expect(pkt.item3).to eql 0
190
+ expect(pkt.item4).to eql 0
191
191
  end
192
192
 
193
- it "should identify TGT1 PKT2" do
193
+ it "identifies TGT1 PKT2" do
194
194
  buffer = "\x02\x02"
195
195
  pkt = @cmd.identify(buffer)
196
196
  pkt.enable_method_missing
197
- pkt.item1.should eql 2
198
- pkt.item2.should eql "GOOD"
197
+ expect(pkt.item1).to eql 2
198
+ expect(pkt.item2).to eql "GOOD"
199
199
  end
200
200
 
201
- it "should identify TGT2 PKT1" do
201
+ it "identifies TGT2 PKT1" do
202
202
  buffer = "\x03\x02"
203
203
  pkt = @cmd.identify(buffer)
204
204
  pkt.enable_method_missing
205
- pkt.item1.should eql 3
206
- pkt.item2.should eql 2
205
+ expect(pkt.item1).to eql 3
206
+ expect(pkt.item2).to eql 2
207
207
  end
208
208
  end
209
209
  end
210
210
 
211
211
  describe "build_cmd" do
212
- it "should complain about non-existant targets" do
212
+ it "complains about non-existant targets" do
213
213
  expect { @cmd.build_cmd("tgtX","pkt1") }.to raise_error(RuntimeError, "Command target 'TGTX' does not exist")
214
214
  end
215
215
 
216
- it "should complain about non-existant packets" do
216
+ it "complains about non-existant packets" do
217
217
  expect { @cmd.build_cmd("tgt1","pktX") }.to raise_error(RuntimeError, "Command packet 'TGT1 PKTX' does not exist")
218
218
  end
219
219
 
220
- it "should complain about non-existant items" do
220
+ it "complains about non-existant items" do
221
221
  expect { cmd = @cmd.build_cmd("tgt1","pkt1",{"itemX"=>1}) }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
222
222
  end
223
223
 
224
- it "should create a populated command packet with default values" do
224
+ it "creates a populated command packet with default values" do
225
225
  cmd = @cmd.build_cmd("TGT1","PKT1")
226
226
  cmd.enable_method_missing
227
- cmd.item1.should eql 1
228
- cmd.item2.should eql 2
229
- cmd.item3.should eql 3
230
- cmd.item4.should eql 4
227
+ expect(cmd.item1).to eql 1
228
+ expect(cmd.item2).to eql 2
229
+ expect(cmd.item3).to eql 3
230
+ expect(cmd.item4).to eql 4
231
231
  end
232
232
 
233
- it "should complain about out of range item values" do
233
+ it "complains about out of range item values" do
234
234
  expect { @cmd.build_cmd("tgt1","pkt1",{"item2"=>1000}) }.to raise_error(RuntimeError, "Command parameter 'TGT1 PKT1 ITEM2' = 1000 not in valid range of 0 to 254")
235
235
  end
236
236
 
237
- it "should ignore out of range item values if requested" do
237
+ it "ignores out of range item values if requested" do
238
238
  cmd = @cmd.build_cmd("tgt1","pkt1",{"item2"=>255}, false)
239
239
  cmd.enable_method_missing
240
- cmd.item1.should eql 1
241
- cmd.item2.should eql 255
242
- cmd.item3.should eql 3
243
- cmd.item4.should eql 4
240
+ expect(cmd.item1).to eql 1
241
+ expect(cmd.item2).to eql 255
242
+ expect(cmd.item3).to eql 3
243
+ expect(cmd.item4).to eql 4
244
244
  end
245
245
 
246
- it "should create a command packet with override item values" do
246
+ it "creates a command packet with override item values" do
247
247
  items = {"ITEM2" => 10, "ITEM4" => 11}
248
248
  cmd = @cmd.build_cmd("TGT1","PKT1",items)
249
249
  cmd.enable_method_missing
250
- cmd.item1.should eql 1
251
- cmd.item2.should eql 10
252
- cmd.item3.should eql 3
253
- cmd.item4.should eql 11
250
+ expect(cmd.item1).to eql 1
251
+ expect(cmd.item2).to eql 10
252
+ expect(cmd.item3).to eql 3
253
+ expect(cmd.item4).to eql 11
254
254
  end
255
255
 
256
- it "should create a command packet with override item value states" do
256
+ it "creates a command packet with override item value states" do
257
257
  items = {"ITEM2" => "GOOD"}
258
258
  cmd = @cmd.build_cmd("TGT1","PKT2",items)
259
259
  cmd.enable_method_missing
260
- cmd.item1.should eql 2
261
- cmd.item2.should eql "GOOD"
262
- cmd.read("ITEM2",:RAW).should eql 2
260
+ expect(cmd.item1).to eql 2
261
+ expect(cmd.item2).to eql "GOOD"
262
+ expect(cmd.read("ITEM2",:RAW)).to eql 2
263
263
  end
264
264
 
265
- it "should complain about missing required parameters" do
265
+ it "complains about missing required parameters" do
266
266
  expect { @cmd.build_cmd("tgt2","pkt3") }.to raise_error(RuntimeError, "Required command parameter 'TGT2 PKT3 ITEM2' not given")
267
267
  end
268
268
 
269
- it "should support building raw commands" do
269
+ it "supports building raw commands" do
270
270
  items = {"ITEM2" => 10}
271
271
  cmd = @cmd.build_cmd("TGT2","PKT5",items,false,false)
272
- cmd.raw.should eql false
273
- cmd.read("ITEM2").should eql 20
272
+ expect(cmd.raw).to eql false
273
+ expect(cmd.read("ITEM2")).to eql 20
274
274
  items = {"ITEM2" => 10}
275
275
  cmd = @cmd.build_cmd("TGT1","PKT1",items,false,true)
276
- cmd.raw.should eql true
277
- cmd.read("ITEM2").should eql 10
276
+ expect(cmd.raw).to eql true
277
+ expect(cmd.read("ITEM2")).to eql 10
278
278
  end
279
279
  end
280
280
 
281
281
  describe "format" do
282
- it "should create a string representation of a command" do
282
+ it "creates a string representation of a command" do
283
283
  pkt = @cmd.packet("TGT1","PKT1")
284
- @cmd.format(pkt).should eql "cmd('TGT1 PKT1 with ITEM1 0, ITEM2 0, ITEM3 0, ITEM4 0')"
284
+ expect(@cmd.format(pkt)).to eql "cmd('TGT1 PKT1 with ITEM1 0, ITEM2 0, ITEM3 0, ITEM4 0')"
285
285
 
286
286
  pkt = @cmd.packet("TGT2","PKT4")
287
287
  string = ''
288
288
  pkt.write("ITEM2","HELLO WORLD")
289
- @cmd.format(pkt).should eql "cmd('TGT2 PKT4 with ITEM1 0, ITEM2 \"HELLO WORLD\"')"
289
+ expect(@cmd.format(pkt)).to eql "cmd('TGT2 PKT4 with ITEM1 0, ITEM2 \"HELLO WORLD\"')"
290
290
 
291
291
  pkt = @cmd.packet("TGT2","PKT4")
292
292
  string = ''
293
293
  pkt.write("ITEM2","HELLO WORLD")
294
294
  pkt.raw = true
295
- @cmd.format(pkt).should eql "cmd_raw('TGT2 PKT4 with ITEM1 0, ITEM2 \"HELLO WORLD\"')"
295
+ expect(@cmd.format(pkt)).to eql "cmd_raw('TGT2 PKT4 with ITEM1 0, ITEM2 \"HELLO WORLD\"')"
296
296
 
297
297
  # If the string is too big it should truncate it
298
298
  (1..2028).each {|i| string << 'A' }
299
299
  pkt.write("ITEM2",string)
300
300
  pkt.raw = false
301
301
  result = @cmd.format(pkt)
302
- result.should match(/cmd\('TGT2 PKT4 with ITEM1 0, ITEM2 \"AAAAAAAAAAA/)
303
- result.should match(/AAAAAAAAAAA.../)
302
+ expect(result).to match(/cmd\('TGT2 PKT4 with ITEM1 0, ITEM2 \"AAAAAAAAAAA/)
303
+ expect(result).to match(/AAAAAAAAAAA.../)
304
304
  end
305
305
 
306
- it "should ignore parameters" do
306
+ it "ignores parameters" do
307
307
  pkt = @cmd.packet("TGT1","PKT1")
308
- @cmd.format(pkt,['ITEM3','ITEM4']).should eql "cmd('TGT1 PKT1 with ITEM1 0, ITEM2 0')"
308
+ expect(@cmd.format(pkt,['ITEM3','ITEM4'])).to eql "cmd('TGT1 PKT1 with ITEM1 0, ITEM2 0')"
309
309
  end
310
310
  end
311
311
 
312
312
  describe "cmd_hazardous?" do
313
- it "should complain about non-existant targets" do
313
+ it "complains about non-existant targets" do
314
314
  expect { @cmd.cmd_hazardous?("tgtX","pkt1") }.to raise_error(RuntimeError, "Command target 'TGTX' does not exist")
315
315
  end
316
316
 
317
- it "should complain about non-existant packets" do
317
+ it "complains about non-existant packets" do
318
318
  expect { @cmd.cmd_hazardous?("tgt1","pktX") }.to raise_error(RuntimeError, "Command packet 'TGT1 PKTX' does not exist")
319
319
  end
320
320
 
321
- it "should complain about non-existant items" do
321
+ it "complains about non-existant items" do
322
322
  expect { cmd = @cmd.cmd_hazardous?("tgt1","pkt1",{"itemX"=>1}) }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
323
323
  end
324
324
 
325
- it "should return true if the command overall is hazardous" do
325
+ it "returns true if the command overall is hazardous" do
326
326
  hazardous, description = @cmd.cmd_hazardous?("TGT1","PKT1")
327
- hazardous.should be_falsey
328
- description.should be_nil
327
+ expect(hazardous).to be_falsey
328
+ expect(description).to be_nil
329
329
  hazardous, description = @cmd.cmd_hazardous?("tgt2","pkt3")
330
- hazardous.should be_truthy
331
- description.should eql "Hazardous"
330
+ expect(hazardous).to be_truthy
331
+ expect(description).to eql "Hazardous"
332
332
  end
333
333
 
334
- it "should return true if a command parameter is hazardous" do
334
+ it "returns true if a command parameter is hazardous" do
335
335
  hazardous, description = @cmd.cmd_hazardous?("TGT1","PKT2",{"ITEM2"=>0})
336
- hazardous.should be_truthy
337
- description.should eql "Hazardous"
336
+ expect(hazardous).to be_truthy
337
+ expect(description).to eql "Hazardous"
338
338
  hazardous, description = @cmd.cmd_hazardous?("TGT1","PKT2",{"ITEM2"=>1})
339
- hazardous.should be_truthy
340
- description.should eql ""
339
+ expect(hazardous).to be_truthy
340
+ expect(description).to eql ""
341
341
  hazardous, description = @cmd.cmd_hazardous?("TGT1","PKT2",{"ITEM2"=>2})
342
- hazardous.should be_falsey
343
- description.should be_nil
342
+ expect(hazardous).to be_falsey
343
+ expect(description).to be_nil
344
344
  end
345
345
  end
346
346
 
347
347
  describe "clear_counters" do
348
- it "should clear the received counters in all packets" do
348
+ it "clears the received counters in all packets" do
349
349
  @cmd.packet("TGT1","PKT1").received_count = 1
350
350
  @cmd.packet("TGT1","PKT2").received_count = 2
351
351
  @cmd.packet("TGT2","PKT3").received_count = 3
352
352
  @cmd.packet("TGT2","PKT4").received_count = 4
353
353
  @cmd.clear_counters
354
- @cmd.packet("TGT1","PKT1").received_count.should eql 0
355
- @cmd.packet("TGT1","PKT2").received_count.should eql 0
356
- @cmd.packet("TGT2","PKT3").received_count.should eql 0
357
- @cmd.packet("TGT2","PKT4").received_count.should eql 0
354
+ expect(@cmd.packet("TGT1","PKT1").received_count).to eql 0
355
+ expect(@cmd.packet("TGT1","PKT2").received_count).to eql 0
356
+ expect(@cmd.packet("TGT2","PKT3").received_count).to eql 0
357
+ expect(@cmd.packet("TGT2","PKT4").received_count).to eql 0
358
358
  end
359
359
  end
360
360
 
361
361
  describe "all" do
362
- it "should return all packets" do
363
- @cmd.all.keys.should eql %w(UNKNOWN TGT1 TGT2)
362
+ it "returns all packets" do
363
+ expect(@cmd.all.keys).to eql %w(UNKNOWN TGT1 TGT2)
364
364
  end
365
365
  end
366
366
 
@@ -17,7 +17,7 @@ module Cosmos
17
17
  describe LimitsResponse do
18
18
 
19
19
  describe "call" do
20
- it "should raise an exception" do
20
+ it "raises an exception" do
21
21
  expect { LimitsResponse.new.call(nil,nil,nil) }.to raise_error(/defined by subclass/)
22
22
  end
23
23
  end
@@ -59,53 +59,53 @@ module Cosmos
59
59
  end
60
60
 
61
61
  describe "initialize" do
62
- it "should have no warnings" do
63
- Limits.new(PacketConfig.new).warnings.should be_empty
62
+ it "has no warnings" do
63
+ expect(Limits.new(PacketConfig.new).warnings).to be_empty
64
64
  end
65
65
  end
66
66
 
67
67
  describe "sets" do
68
- it "should return the defined limits set" do
69
- @limits.sets.should eql [:DEFAULT, :TVAC]
68
+ it "returns the defined limits set" do
69
+ expect(@limits.sets).to eql [:DEFAULT, :TVAC]
70
70
  end
71
71
  end
72
72
 
73
73
  describe "groups" do
74
- it "should return the limits groups" do
75
- @limits.groups.should_not be_empty
74
+ it "returns the limits groups" do
75
+ expect(@limits.groups).not_to be_empty
76
76
  end
77
77
  end
78
78
 
79
79
  describe "config=" do
80
- it "should set the underlying configuration" do
80
+ it "sets the underlying configuration" do
81
81
  tf = Tempfile.new('unittest')
82
82
  tf.puts ''
83
83
  tf.close
84
84
  pc = PacketConfig.new
85
85
  pc.process_file(tf.path, "SYSTEM")
86
- @limits.sets.should eql [:DEFAULT, :TVAC]
87
- @limits.groups.should_not be_empty
86
+ expect(@limits.sets).to eql [:DEFAULT, :TVAC]
87
+ expect(@limits.groups).not_to be_empty
88
88
  @limits.config = pc
89
- @limits.sets.should eql [:DEFAULT]
90
- @limits.groups.should eql({})
89
+ expect(@limits.sets).to eql [:DEFAULT]
90
+ expect(@limits.groups).to eql({})
91
91
  tf.unlink
92
92
  end
93
93
  end
94
94
 
95
95
  describe "out_of_limits" do
96
- it "should return all out of limits telemetry items" do
96
+ it "returns all out of limits telemetry items" do
97
97
  @tlm.update!("TGT1","PKT1","\x00\x03\x03\x04\x05")
98
98
  @tlm.packet("TGT1","PKT1").check_limits
99
99
  items = @limits.out_of_limits
100
- items[0][0].should eql "TGT1"
101
- items[0][1].should eql "PKT1"
102
- items[0][2].should eql "ITEM1"
103
- items[0][3].should eql :RED_LOW
100
+ expect(items[0][0]).to eql "TGT1"
101
+ expect(items[0][1]).to eql "PKT1"
102
+ expect(items[0][2]).to eql "ITEM1"
103
+ expect(items[0][3]).to eql :RED_LOW
104
104
  end
105
105
  end
106
106
 
107
107
  describe "overall_limits_state" do
108
- it "should return overall limits state of the system" do
108
+ it "returns overall limits state of the system" do
109
109
  # Cause packet 2 to be green
110
110
  @tlm.update!("TGT1","PKT2","\x03\x03")
111
111
  @tlm.packet("TGT1","PKT2").check_limits
@@ -134,7 +134,7 @@ module Cosmos
134
134
  expect(@limits.overall_limits_state).to eq :RED
135
135
  end
136
136
 
137
- it "should mark a stale packet green if all items are ignored" do
137
+ it "marks a stale packet green if all items are ignored" do
138
138
  # Cause packet 2 to be green
139
139
  @tlm.update!("TGT1","PKT2","\x03\x03")
140
140
  @tlm.packet("TGT1","PKT2").check_limits
@@ -145,7 +145,7 @@ module Cosmos
145
145
  expect(@limits.overall_limits_state([%w(TGT1 PKT1 ITEM1),%w(TGT1 PKT1 ITEM2),%w(TGT1 PKT1 ITEM3),%w(TGT1 PKT1 ITEM4)])).to eq :GREEN
146
146
  end
147
147
 
148
- it "should handle non-existant ignored telemetry items" do
148
+ it "handles non-existant ignored telemetry items" do
149
149
  # Cause packet 2 to be green
150
150
  @tlm.update!("TGT1","PKT2","\x03\x03")
151
151
  @tlm.packet("TGT1","PKT2").check_limits
@@ -156,7 +156,7 @@ module Cosmos
156
156
  expect(@limits.overall_limits_state([%w(TGT1 PKT1 BLAH)])).to eq :YELLOW
157
157
  end
158
158
 
159
- it "should ignore specified telemetry items" do
159
+ it "ignores specified telemetry items" do
160
160
  # Cause packet 2 to be green
161
161
  @tlm.update!("TGT1","PKT2","\x03\x03")
162
162
  @tlm.packet("TGT1","PKT2").check_limits
@@ -174,11 +174,11 @@ module Cosmos
174
174
  end
175
175
 
176
176
  describe "enable_group" do
177
- it "should complain about undefined limits groups" do
177
+ it "complains about undefined limits groups" do
178
178
  expect { @limits.enable_group("MINE") }.to raise_error(RuntimeError, "LIMITS_GROUP MINE undefined. Ensure your telemetry definition contains the line: LIMITS_GROUP MINE")
179
179
  end
180
180
 
181
- it "should complain about undefined items" do
181
+ it "complains about undefined items" do
182
182
  tf = Tempfile.new('unittest')
183
183
  tf.puts 'LIMITS_GROUP GROUP1'
184
184
  tf.puts ' LIMITS_GROUP_ITEM TGT1 PKT1 ITEM1'
@@ -190,134 +190,134 @@ module Cosmos
190
190
  tf.unlink
191
191
  end
192
192
 
193
- it "should enable limits for all items in the group" do
193
+ it "enables limits for all items in the group" do
194
194
  @limits.enable_group("group1")
195
195
  pkt = @tlm.packet("TGT1","PKT1")
196
- pkt.get_item("ITEM1").limits.enabled.should be_truthy
197
- pkt.get_item("ITEM2").limits.enabled.should be_truthy
198
- pkt.get_item("ITEM3").limits.enabled.should be_truthy
199
- pkt.get_item("ITEM4").limits.enabled.should be_truthy
200
- pkt.get_item("ITEM5").limits.enabled.should be_falsey
196
+ expect(pkt.get_item("ITEM1").limits.enabled).to be_truthy
197
+ expect(pkt.get_item("ITEM2").limits.enabled).to be_truthy
198
+ expect(pkt.get_item("ITEM3").limits.enabled).to be_truthy
199
+ expect(pkt.get_item("ITEM4").limits.enabled).to be_truthy
200
+ expect(pkt.get_item("ITEM5").limits.enabled).to be_falsey
201
201
  end
202
202
  end
203
203
 
204
204
  describe "disable_group" do
205
- it "should complain about undefined limits groups" do
205
+ it "complains about undefined limits groups" do
206
206
  expect { @limits.disable_group("MINE") }.to raise_error(RuntimeError, "LIMITS_GROUP MINE undefined. Ensure your telemetry definition contains the line: LIMITS_GROUP MINE")
207
207
  end
208
208
 
209
- it "should disable limits for all items in the group" do
209
+ it "disables limits for all items in the group" do
210
210
  pkt = @tlm.packet("TGT1","PKT1")
211
211
  pkt.enable_limits("ITEM1")
212
212
  pkt.enable_limits("ITEM2")
213
- pkt.get_item("ITEM1").limits.enabled.should be_truthy
214
- pkt.get_item("ITEM2").limits.enabled.should be_truthy
213
+ expect(pkt.get_item("ITEM1").limits.enabled).to be_truthy
214
+ expect(pkt.get_item("ITEM2").limits.enabled).to be_truthy
215
215
 
216
216
  @limits.disable_group("group1")
217
- pkt.get_item("ITEM1").limits.enabled.should be_falsey
218
- pkt.get_item("ITEM2").limits.enabled.should be_falsey
217
+ expect(pkt.get_item("ITEM1").limits.enabled).to be_falsey
218
+ expect(pkt.get_item("ITEM2").limits.enabled).to be_falsey
219
219
  end
220
220
  end
221
221
 
222
222
  describe "enabled?" do
223
- it "should complain about non-existant targets" do
223
+ it "complains about non-existant targets" do
224
224
  expect { @limits.enabled?("TGTX","PKT1","ITEM1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
225
225
  end
226
226
 
227
- it "should complain about non-existant packets" do
227
+ it "complains about non-existant packets" do
228
228
  expect { @limits.enabled?("TGT1","PKTX","ITEM1") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
229
229
  end
230
230
 
231
- it "should complain about non-existant items" do
231
+ it "complains about non-existant items" do
232
232
  expect { @limits.enabled?("TGT1","PKT1","ITEMX") }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
233
233
  end
234
234
 
235
- it "should return whether limits are enable for an item" do
235
+ it "returns whether limits are enable for an item" do
236
236
  pkt = @tlm.packet("TGT1","PKT1")
237
- @limits.enabled?("TGT1","PKT1","ITEM5").should be_falsey
237
+ expect(@limits.enabled?("TGT1","PKT1","ITEM5")).to be_falsey
238
238
  pkt.enable_limits("ITEM5")
239
- @limits.enabled?("TGT1","PKT1","ITEM5").should be_truthy
239
+ expect(@limits.enabled?("TGT1","PKT1","ITEM5")).to be_truthy
240
240
  end
241
241
  end
242
242
 
243
243
  describe "enable" do
244
- it "should complain about non-existant targets" do
244
+ it "complains about non-existant targets" do
245
245
  expect { @limits.enable("TGTX","PKT1","ITEM1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
246
246
  end
247
247
 
248
- it "should complain about non-existant packets" do
248
+ it "complains about non-existant packets" do
249
249
  expect { @limits.enable("TGT1","PKTX","ITEM1") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
250
250
  end
251
251
 
252
- it "should complain about non-existant items" do
252
+ it "complains about non-existant items" do
253
253
  expect { @limits.enable("TGT1","PKT1","ITEMX") }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
254
254
  end
255
255
 
256
- it "should enable limits for an item" do
256
+ it "enables limits for an item" do
257
257
  pkt = @tlm.packet("TGT1","PKT1")
258
- @limits.enabled?("TGT1","PKT1","ITEM5").should be_falsey
258
+ expect(@limits.enabled?("TGT1","PKT1","ITEM5")).to be_falsey
259
259
  @limits.enable("TGT1","PKT1","ITEM5")
260
- @limits.enabled?("TGT1","PKT1","ITEM5").should be_truthy
260
+ expect(@limits.enabled?("TGT1","PKT1","ITEM5")).to be_truthy
261
261
  end
262
262
  end
263
263
 
264
264
  describe "disable" do
265
- it "should complain about non-existant targets" do
265
+ it "complains about non-existant targets" do
266
266
  expect { @limits.disable("TGTX","PKT1","ITEM1") }.to raise_error(RuntimeError, "Telemetry target 'TGTX' does not exist")
267
267
  end
268
268
 
269
- it "should complain about non-existant packets" do
269
+ it "complains about non-existant packets" do
270
270
  expect { @limits.disable("TGT1","PKTX","ITEM1") }.to raise_error(RuntimeError, "Telemetry packet 'TGT1 PKTX' does not exist")
271
271
  end
272
272
 
273
- it "should complain about non-existant items" do
273
+ it "complains about non-existant items" do
274
274
  expect { @limits.disable("TGT1","PKT1","ITEMX") }.to raise_error(RuntimeError, "Packet item 'TGT1 PKT1 ITEMX' does not exist")
275
275
  end
276
276
 
277
- it "should disable limits for an item" do
277
+ it "disables limits for an item" do
278
278
  pkt = @tlm.packet("TGT1","PKT1")
279
279
  @limits.enable("TGT1","PKT1","ITEM1")
280
- @limits.enabled?("TGT1","PKT1","ITEM1").should be_truthy
280
+ expect(@limits.enabled?("TGT1","PKT1","ITEM1")).to be_truthy
281
281
  @limits.disable("TGT1","PKT1","ITEM1")
282
- @limits.enabled?("TGT1","PKT1","ITEM1").should be_falsey
282
+ expect(@limits.enabled?("TGT1","PKT1","ITEM1")).to be_falsey
283
283
  end
284
284
  end
285
285
 
286
286
  describe "get" do
287
- it "should get the limits for an item with limits" do
288
- @limits.get("TGT1", "PKT1", "ITEM1").should eql [:DEFAULT, 1, true, 1.0, 2.0, 4.0, 5.0, nil, nil]
287
+ it "gets the limits for an item with limits" do
288
+ expect(@limits.get("TGT1", "PKT1", "ITEM1")).to eql [:DEFAULT, 1, true, 1.0, 2.0, 4.0, 5.0, nil, nil]
289
289
  end
290
290
 
291
- it "should handle an item without limits" do
292
- @limits.get("TGT1", "PKT1", "ITEM5").should eql [nil, nil, nil, nil, nil, nil, nil, nil, nil]
291
+ it "handles an item without limits" do
292
+ expect(@limits.get("TGT1", "PKT1", "ITEM5")).to eql [nil, nil, nil, nil, nil, nil, nil, nil, nil]
293
293
  end
294
294
 
295
- it "should support a specified limits set" do
296
- @limits.get("TGT1", "PKT1", "ITEM1", :TVAC).should eql [:TVAC, 1, true, 6.0, 7.0, 12.0, 13.0, 9.0, 10.0]
295
+ it "supports a specified limits set" do
296
+ expect(@limits.get("TGT1", "PKT1", "ITEM1", :TVAC)).to eql [:TVAC, 1, true, 6.0, 7.0, 12.0, 13.0, 9.0, 10.0]
297
297
  end
298
298
 
299
- it "should handle an item without limits for the given limits set" do
300
- @limits.get("TGT1", "PKT2", "ITEM1", :TVAC).should eql [nil, nil, nil, nil, nil, nil, nil, nil, nil]
299
+ it "handles an item without limits for the given limits set" do
300
+ expect(@limits.get("TGT1", "PKT2", "ITEM1", :TVAC)).to eql [nil, nil, nil, nil, nil, nil, nil, nil, nil]
301
301
  end
302
302
  end
303
303
 
304
304
  describe "set" do
305
- it "should set limits for an item" do
306
- @limits.set("TGT1", "PKT1", "ITEM5", 1, 2, 3, 4, nil, nil, :DEFAULT).should eql [:DEFAULT, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
305
+ it "sets limits for an item" do
306
+ expect(@limits.set("TGT1", "PKT1", "ITEM5", 1, 2, 3, 4, nil, nil, :DEFAULT)).to eql [:DEFAULT, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
307
307
  end
308
308
 
309
- it "should enforce setting DEFAULT limits first" do
309
+ it "enforces setting DEFAULT limits first" do
310
310
  expect { @limits.set("TGT1", "PKT1", "ITEM5", 1, 2, 3, 4) }.to raise_error(RuntimeError, "DEFAULT limits must be defined for TGT1 PKT1 ITEM5 before setting limits set CUSTOM")
311
- @limits.set("TGT1", "PKT1", "ITEM5", 5, 6, 7, 8, nil, nil, :DEFAULT).should eql [:DEFAULT, 1, true, 5.0, 6.0, 7.0, 8.0, nil, nil]
312
- @limits.set("TGT1", "PKT1", "ITEM5", 1, 2, 3, 4).should eql [:CUSTOM, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
311
+ expect(@limits.set("TGT1", "PKT1", "ITEM5", 5, 6, 7, 8, nil, nil, :DEFAULT)).to eql [:DEFAULT, 1, true, 5.0, 6.0, 7.0, 8.0, nil, nil]
312
+ expect(@limits.set("TGT1", "PKT1", "ITEM5", 1, 2, 3, 4)).to eql [:CUSTOM, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
313
313
  end
314
314
 
315
- it "should allow setting other limits sets" do
316
- @limits.set("TGT1", "PKT1", "ITEM1", 1, 2, 3, 4, nil, nil, :TVAC).should eql [:TVAC, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
315
+ it "allows setting other limits sets" do
316
+ expect(@limits.set("TGT1", "PKT1", "ITEM1", 1, 2, 3, 4, nil, nil, :TVAC)).to eql [:TVAC, 1, true, 1.0, 2.0, 3.0, 4.0, nil, nil]
317
317
  end
318
318
 
319
- it "should handle green limits" do
320
- @limits.set("TGT1", "PKT1", "ITEM1", 1, 2, 5, 6, 3, 4, nil).should eql [:DEFAULT, 1, true, 1.0, 2.0, 5.0, 6.0, 3.0, 4.0]
319
+ it "handles green limits" do
320
+ expect(@limits.set("TGT1", "PKT1", "ITEM1", 1, 2, 5, 6, 3, 4, nil)).to eql [:DEFAULT, 1, true, 1.0, 2.0, 5.0, 6.0, 3.0, 4.0]
321
321
  end
322
322
  end
323
323