arachni 1.2.1 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (373) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -0
  3. data/Gemfile +1 -1
  4. data/README.md +16 -5
  5. data/components/checks/active/ldap_injection/errors.txt +1 -0
  6. data/components/checks/active/source_code_disclosure.rb +1 -1
  7. data/components/checks/active/unvalidated_redirect.rb +6 -6
  8. data/components/checks/active/unvalidated_redirect_dom.rb +10 -7
  9. data/components/checks/passive/grep/captcha.rb +14 -5
  10. data/components/checks/passive/grep/form_upload.rb +7 -3
  11. data/components/checks/passive/grep/hsts.rb +3 -3
  12. data/components/checks/passive/grep/html_objects.rb +2 -3
  13. data/components/checks/passive/grep/http_only_cookies.rb +2 -3
  14. data/components/checks/passive/grep/insecure_cookies.rb +1 -1
  15. data/components/checks/passive/grep/password_autocomplete.rb +2 -2
  16. data/components/checks/passive/grep/unencrypted_password_forms.rb +7 -7
  17. data/components/checks/passive/grep/x_frame_options.rb +2 -2
  18. data/components/checks/passive/http_put.rb +2 -3
  19. data/components/path_extractors/comments.rb +3 -3
  20. data/components/path_extractors/scripts.rb +10 -1
  21. data/components/plugins/defaults/autothrottle.rb +27 -18
  22. data/components/plugins/defaults/meta/remedies/discovery.rb +30 -33
  23. data/components/plugins/defaults/meta/remedies/timing_attacks.rb +7 -11
  24. data/components/plugins/login_script.rb +9 -3
  25. data/components/plugins/proxy.rb +4 -3
  26. data/components/reporters/html.rb +11 -14
  27. data/components/reporters/html/default/issue.erb +13 -38
  28. data/components/reporters/html/default/issue/info.erb +1 -1
  29. data/components/reporters/html/default/summary/issues/by_name.erb +3 -3
  30. data/components/reporters/stdout.rb +62 -71
  31. data/components/reporters/xml.rb +26 -40
  32. data/components/reporters/xml/schema.xsd +43 -89
  33. data/lib/arachni/browser.rb +52 -3
  34. data/lib/arachni/browser/javascript.rb +3 -3
  35. data/lib/arachni/browser/javascript/scripts/taint_tracer.js +46 -25
  36. data/lib/arachni/browser_cluster.rb +61 -0
  37. data/lib/arachni/browser_cluster/job.rb +21 -1
  38. data/lib/arachni/browser_cluster/jobs/browser_provider.rb +3 -1
  39. data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +2 -1
  40. data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb +2 -1
  41. data/lib/arachni/browser_cluster/jobs/taint_trace.rb +3 -2
  42. data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +1 -1
  43. data/lib/arachni/browser_cluster/worker.rb +5 -0
  44. data/lib/arachni/check/auditor.rb +22 -12
  45. data/lib/arachni/data/framework.rb +13 -1
  46. data/lib/arachni/data/issues.rb +9 -25
  47. data/lib/arachni/element/base.rb +9 -3
  48. data/lib/arachni/element/capabilities/analyzable.rb +2 -6
  49. data/lib/arachni/element/capabilities/analyzable/differential.rb +24 -7
  50. data/lib/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +23 -23
  51. data/lib/arachni/element/capabilities/auditable.rb +0 -6
  52. data/lib/arachni/element/capabilities/dom_only.rb +61 -0
  53. data/lib/arachni/element/capabilities/with_dom.rb +3 -1
  54. data/lib/arachni/element/cookie.rb +35 -5
  55. data/lib/arachni/element/cookie/dom.rb +13 -4
  56. data/lib/arachni/element/{capabilities/auditable/dom.rb → dom.rb} +20 -68
  57. data/lib/arachni/element/dom/capabilities/auditable.rb +29 -0
  58. data/lib/arachni/element/dom/capabilities/inputtable.rb +27 -0
  59. data/lib/arachni/element/dom/capabilities/mutable.rb +21 -0
  60. data/lib/arachni/element/dom/capabilities/submittable.rb +52 -0
  61. data/lib/arachni/element/form.rb +12 -1
  62. data/lib/arachni/element/form/capabilities/mutable.rb +2 -1
  63. data/lib/arachni/element/form/capabilities/with_dom.rb +0 -1
  64. data/lib/arachni/element/form/dom.rb +9 -3
  65. data/lib/arachni/element/header.rb +14 -33
  66. data/lib/arachni/element/header/capabilities/inputtable.rb +29 -0
  67. data/lib/arachni/element/header/capabilities/mutable.rb +51 -0
  68. data/lib/arachni/element/input/dom.rb +71 -0
  69. data/lib/arachni/element/json.rb +2 -0
  70. data/lib/arachni/element/link.rb +3 -0
  71. data/lib/arachni/element/link/capabilities/with_dom.rb +0 -1
  72. data/lib/arachni/element/link/dom.rb +16 -3
  73. data/lib/arachni/element/link/dom/capabilities/submittable.rb +29 -0
  74. data/lib/arachni/element/link_template.rb +3 -5
  75. data/lib/arachni/element/link_template/capabilities/inputtable.rb +5 -0
  76. data/lib/arachni/element/link_template/capabilities/with_dom.rb +0 -1
  77. data/lib/arachni/element/link_template/dom.rb +16 -3
  78. data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +29 -0
  79. data/lib/arachni/element/server.rb +3 -5
  80. data/lib/arachni/element/ui_form.rb +106 -0
  81. data/lib/arachni/element/ui_form/dom.rb +107 -0
  82. data/lib/arachni/element/ui_input.rb +62 -0
  83. data/lib/arachni/element/xml.rb +2 -1
  84. data/lib/arachni/framework.rb +7 -5
  85. data/lib/arachni/framework/parts/audit.rb +0 -1
  86. data/lib/arachni/framework/parts/check.rb +1 -0
  87. data/lib/arachni/framework/parts/data.rb +4 -0
  88. data/lib/arachni/framework/parts/state.rb +0 -2
  89. data/lib/arachni/http/client.rb +17 -6
  90. data/lib/arachni/http/proxy_server.rb +52 -5
  91. data/lib/arachni/http/request.rb +1 -1
  92. data/lib/arachni/issue.rb +34 -179
  93. data/lib/arachni/issue/severity.rb +2 -0
  94. data/lib/arachni/option_groups/audit.rb +22 -2
  95. data/lib/arachni/option_groups/browser_cluster.rb +15 -0
  96. data/lib/arachni/page.rb +3 -2
  97. data/lib/arachni/parser.rb +24 -5
  98. data/lib/arachni/platform/manager.rb +1 -2
  99. data/lib/arachni/rpc/server/framework.rb +3 -4
  100. data/lib/arachni/rpc/server/framework/multi_instance.rb +2 -1
  101. data/lib/arachni/session.rb +1 -1
  102. data/lib/arachni/trainer.rb +4 -7
  103. data/lib/arachni/watir/element.rb +12 -1
  104. data/lib/version +1 -1
  105. data/spec/arachni/browser/element_locator_spec.rb +43 -43
  106. data/spec/arachni/browser/javascript/dom_monitor_spec.rb +44 -44
  107. data/spec/arachni/browser/javascript/proxy/stub_spec.rb +17 -14
  108. data/spec/arachni/browser/javascript/proxy_spec.rb +24 -24
  109. data/spec/arachni/browser/javascript/taint_tracer/frame/called_function_spec.rb +11 -11
  110. data/spec/arachni/browser/javascript/taint_tracer/frame_spec.rb +7 -7
  111. data/spec/arachni/browser/javascript/taint_tracer/sink/data_flow_spec.rb +13 -13
  112. data/spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb +7 -7
  113. data/spec/arachni/browser/javascript/taint_tracer_spec.rb +568 -558
  114. data/spec/arachni/browser/javascript_spec.rb +73 -63
  115. data/spec/arachni/browser_cluster/job/result_spec.rb +3 -3
  116. data/spec/arachni/browser_cluster/job_spec.rb +68 -48
  117. data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result_spec.rb +2 -2
  118. data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger_spec.rb +5 -4
  119. data/spec/arachni/browser_cluster/jobs/resource_exploration/result_spec.rb +2 -2
  120. data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +5 -5
  121. data/spec/arachni/browser_cluster/worker_spec.rb +87 -70
  122. data/spec/arachni/browser_cluster_spec.rb +64 -39
  123. data/spec/arachni/browser_spec.rb +692 -527
  124. data/spec/arachni/check/auditor_spec.rb +177 -147
  125. data/spec/arachni/check/base_spec.rb +33 -33
  126. data/spec/arachni/check/manager_spec.rb +15 -15
  127. data/spec/arachni/component/base_spec.rb +8 -8
  128. data/spec/arachni/component/manager_spec.rb +100 -99
  129. data/spec/arachni/component/options/address_spec.rb +3 -3
  130. data/spec/arachni/component/options/base_spec.rb +7 -7
  131. data/spec/arachni/component/options/bool_spec.rb +9 -9
  132. data/spec/arachni/component/options/float_spec.rb +6 -6
  133. data/spec/arachni/component/options/int_spec.rb +5 -5
  134. data/spec/arachni/component/options/multiple_choice_spec.rb +12 -12
  135. data/spec/arachni/component/options/object_spec.rb +2 -2
  136. data/spec/arachni/component/options/path_spec.rb +3 -3
  137. data/spec/arachni/component/options/port_spec.rb +5 -5
  138. data/spec/arachni/component/options/string_spec.rb +3 -3
  139. data/spec/arachni/component/options/url_spec.rb +4 -4
  140. data/spec/arachni/component/utilities_spec.rb +2 -2
  141. data/spec/arachni/data/framework/rpc_spec.rb +10 -9
  142. data/spec/arachni/data/framework_spec.rb +65 -46
  143. data/spec/arachni/data/issues_spec.rb +39 -77
  144. data/spec/arachni/data/plugins_spec.rb +11 -11
  145. data/spec/arachni/data/session_spec.rb +6 -6
  146. data/spec/arachni/data_spec.rb +8 -8
  147. data/spec/arachni/element/body_spec.rb +10 -10
  148. data/spec/arachni/element/capabilities/analyzable/differential_spec.rb +39 -21
  149. data/spec/arachni/element/capabilities/analyzable/{taint_spec.rb → signature_spec.rb} +63 -63
  150. data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +51 -51
  151. data/spec/arachni/element/capabilities/with_scope/scope_spec.rb +5 -5
  152. data/spec/arachni/element/cookie/dom_spec.rb +37 -18
  153. data/spec/arachni/element/cookie_spec.rb +206 -139
  154. data/spec/arachni/element/form/dom_spec.rb +36 -19
  155. data/spec/arachni/element/form_spec.rb +210 -187
  156. data/spec/arachni/element/generic_dom_spec.rb +14 -14
  157. data/spec/arachni/element/header_spec.rb +35 -17
  158. data/spec/arachni/element/json_spec.rb +53 -31
  159. data/spec/arachni/element/link/dom_spec.rb +46 -28
  160. data/spec/arachni/element/link_spec.rb +58 -40
  161. data/spec/arachni/element/link_template/dom_spec.rb +47 -29
  162. data/spec/arachni/element/link_template_spec.rb +79 -61
  163. data/spec/arachni/element/path_spec.rb +1 -1
  164. data/spec/arachni/element/server_spec.rb +33 -32
  165. data/spec/arachni/element/ui_form/ui_form_dom_spec.rb +164 -0
  166. data/spec/arachni/element/ui_form_spec.rb +242 -0
  167. data/spec/arachni/element/ui_input/dom_spec.rb +157 -0
  168. data/spec/arachni/element/ui_input_spec.rb +136 -0
  169. data/spec/arachni/element/xml_spec.rb +42 -24
  170. data/spec/arachni/element_filter_spec.rb +49 -48
  171. data/spec/arachni/error_spec.rb +3 -3
  172. data/spec/arachni/framework/parts/audit_spec.rb +64 -63
  173. data/spec/arachni/framework/parts/browser_spec.rb +16 -16
  174. data/spec/arachni/framework/parts/check_spec.rb +3 -3
  175. data/spec/arachni/framework/parts/data_spec.rb +48 -48
  176. data/spec/arachni/framework/parts/platform_spec.rb +3 -3
  177. data/spec/arachni/framework/parts/plugin_spec.rb +7 -6
  178. data/spec/arachni/framework/parts/report_spec.rb +7 -7
  179. data/spec/arachni/framework/parts/scope_spec.rb +16 -16
  180. data/spec/arachni/framework/parts/state_spec.rb +68 -69
  181. data/spec/arachni/framework_spec.rb +39 -31
  182. data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +32 -32
  183. data/spec/arachni/http/client_spec.rb +219 -208
  184. data/spec/arachni/http/cookie_jar_spec.rb +72 -72
  185. data/spec/arachni/http/headers_spec.rb +14 -14
  186. data/spec/arachni/http/proxy_server_spec.rb +43 -42
  187. data/spec/arachni/http/request_spec.rb +105 -103
  188. data/spec/arachni/http/response/scope_spec.rb +24 -24
  189. data/spec/arachni/http/response_spec.rb +50 -49
  190. data/spec/arachni/issue/severity_spec.rb +10 -9
  191. data/spec/arachni/issue_spec.rb +71 -369
  192. data/spec/arachni/option_groups/audit_spec.rb +114 -114
  193. data/spec/arachni/option_groups/browser_cluster_spec.rb +20 -3
  194. data/spec/arachni/option_groups/datastore_spec.rb +6 -6
  195. data/spec/arachni/option_groups/dispatcher_spec.rb +19 -19
  196. data/spec/arachni/option_groups/http_spec.rb +11 -11
  197. data/spec/arachni/option_groups/input_spec.rb +31 -27
  198. data/spec/arachni/option_groups/output_spec.rb +2 -2
  199. data/spec/arachni/option_groups/paths_spec.rb +17 -17
  200. data/spec/arachni/option_groups/rpc_spec.rb +2 -2
  201. data/spec/arachni/option_groups/scope_spec.rb +40 -40
  202. data/spec/arachni/option_groups/session_spec.rb +6 -5
  203. data/spec/arachni/option_groups/snapshot_spec.rb +4 -4
  204. data/spec/arachni/options_spec.rb +46 -45
  205. data/spec/arachni/page/dom/transition_spec.rb +74 -72
  206. data/spec/arachni/page/dom_spec.rb +35 -35
  207. data/spec/arachni/page/scope_spec.rb +15 -15
  208. data/spec/arachni/page_spec.rb +217 -217
  209. data/spec/arachni/parser_spec.rb +106 -104
  210. data/spec/arachni/platform/fingerprinter_spec.rb +17 -14
  211. data/spec/arachni/platform/list_spec.rb +33 -33
  212. data/spec/arachni/platform/manager_spec.rb +67 -64
  213. data/spec/arachni/plugin/base_spec.rb +10 -10
  214. data/spec/arachni/plugin/manager_spec.rb +38 -37
  215. data/spec/arachni/report_spec.rb +43 -40
  216. data/spec/arachni/reporter/base_spec.rb +15 -15
  217. data/spec/arachni/reporter/manager_spec.rb +4 -4
  218. data/spec/arachni/reporter/options_spec.rb +6 -6
  219. data/spec/arachni/rpc/client/base_spec.rb +6 -6
  220. data/spec/arachni/rpc/client/dispatcher_spec.rb +2 -2
  221. data/spec/arachni/rpc/client/instance_spec.rb +6 -6
  222. data/spec/arachni/rpc/server/active_options_spec.rb +11 -8
  223. data/spec/arachni/rpc/server/base_spec.rb +5 -5
  224. data/spec/arachni/rpc/server/checks/manager_spec.rb +8 -8
  225. data/spec/arachni/rpc/server/dispatcher/node_spec.rb +37 -37
  226. data/spec/arachni/rpc/server/dispatcher/service_spec.rb +15 -14
  227. data/spec/arachni/rpc/server/dispatcher_spec.rb +36 -35
  228. data/spec/arachni/rpc/server/framework/distributor_spec.rb +36 -36
  229. data/spec/arachni/rpc/server/framework_multi_spec.rb +340 -336
  230. data/spec/arachni/rpc/server/framework_spec.rb +90 -85
  231. data/spec/arachni/rpc/server/instance_spec.rb +126 -107
  232. data/spec/arachni/rpc/server/output_spec.rb +1 -1
  233. data/spec/arachni/rpc/server/plugin/manager_spec.rb +6 -6
  234. data/spec/arachni/ruby/array_spec.rb +42 -42
  235. data/spec/arachni/ruby/hash_spec.rb +20 -18
  236. data/spec/arachni/ruby/io_spec.rb +2 -2
  237. data/spec/arachni/ruby/object_spec.rb +1 -1
  238. data/spec/arachni/ruby/set_spec.rb +3 -3
  239. data/spec/arachni/ruby/string_spec.rb +30 -30
  240. data/spec/arachni/ruby/webrick_spec.rb +2 -2
  241. data/spec/arachni/scope_spec.rb +1 -1
  242. data/spec/arachni/session_spec.rb +67 -64
  243. data/spec/arachni/snapshot_spec.rb +15 -15
  244. data/spec/arachni/state/audit_spec.rb +11 -11
  245. data/spec/arachni/state/element_filter_spec.rb +6 -6
  246. data/spec/arachni/state/framework/rpc_spec.rb +12 -12
  247. data/spec/arachni/state/framework_spec.rb +125 -121
  248. data/spec/arachni/state/http_spec.rb +7 -7
  249. data/spec/arachni/state/options_spec.rb +7 -7
  250. data/spec/arachni/state/plugins_spec.rb +8 -8
  251. data/spec/arachni/state_spec.rb +10 -10
  252. data/spec/arachni/support/buffer/autoflush_spec.rb +16 -16
  253. data/spec/arachni/support/buffer/base_spec.rb +39 -39
  254. data/spec/arachni/support/cache/least_cost_replacement_spec.rb +18 -18
  255. data/spec/arachni/support/cache/least_recently_pushed_spec.rb +24 -24
  256. data/spec/arachni/support/cache/least_recently_used_spec.rb +20 -20
  257. data/spec/arachni/support/cache/preference_spec.rb +4 -4
  258. data/spec/arachni/support/cache/random_replacement_spec.rb +8 -8
  259. data/spec/arachni/support/crypto/rsa_aes_cbc_spec.rb +1 -1
  260. data/spec/arachni/support/database/hash_spec.rb +44 -43
  261. data/spec/arachni/support/database/queue_spec.rb +27 -27
  262. data/spec/arachni/support/lookup/hash_set_spec.rb +8 -8
  263. data/spec/arachni/support/lookup/moolb_spec.rb +3 -3
  264. data/spec/arachni/support/mixins/observable_spec.rb +6 -6
  265. data/spec/arachni/support/signature_spec.rb +19 -19
  266. data/spec/arachni/trainer_spec.rb +39 -39
  267. data/spec/arachni/typhoeus/hydra_spec.rb +2 -2
  268. data/spec/arachni/uri/scope_spec.rb +66 -66
  269. data/spec/arachni/uri_spec.rb +107 -105
  270. data/spec/arachni/utilities_spec.rb +40 -40
  271. data/spec/components/checks/active/csrf_spec.rb +8 -8
  272. data/spec/components/checks/active/no_sql_injection_spec.rb +1 -1
  273. data/spec/components/checks/active/sql_injection_spec.rb +16 -16
  274. data/spec/components/checks/active/trainer_spec.rb +4 -4
  275. data/spec/components/checks/active/unvalidated_redirect_dom_spec.rb +4 -2
  276. data/spec/components/checks/active/xpath_injection_spec.rb +1 -1
  277. data/spec/components/checks/active/xss_dom_script_context_spec.rb +51 -21
  278. data/spec/components/checks/active/xss_dom_spec.rb +46 -24
  279. data/spec/components/checks/passive/allowed_methods_spec.rb +1 -1
  280. data/spec/components/checks/passive/grep/cookie_set_for_parent_domain_spec.rb +1 -1
  281. data/spec/components/checks/passive/grep/hsts_spec.rb +2 -2
  282. data/spec/components/checks/passive/grep/http_only_cookies_spec.rb +1 -1
  283. data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +1 -1
  284. data/spec/components/checks/passive/grep/insecure_cors_policy_spec.rb +2 -2
  285. data/spec/components/checks/passive/grep/password_autocomplete_spec.rb +1 -1
  286. data/spec/components/checks/passive/grep/private_ip_spec.rb +3 -3
  287. data/spec/components/checks/passive/grep/unencrypted_password_forms_spec.rb +1 -1
  288. data/spec/components/checks/passive/grep/x_frame_options_spec.rb +2 -2
  289. data/spec/components/checks/passive/interesting_responses_spec.rb +2 -2
  290. data/spec/components/checks/passive/webdav_spec.rb +1 -1
  291. data/spec/components/checks/passive/xst_spec.rb +1 -1
  292. data/spec/components/fingerprinters/servers/apache_spec.rb +2 -2
  293. data/spec/components/path_extractors/comments_spec.rb +5 -1
  294. data/spec/components/path_extractors/scripts_spec.rb +5 -2
  295. data/spec/components/plugins/autologin_spec.rb +22 -22
  296. data/spec/components/plugins/autothrottle_spec.rb +6 -5
  297. data/spec/components/plugins/content_types_spec.rb +4 -4
  298. data/spec/components/plugins/cookie_collector_spec.rb +5 -5
  299. data/spec/components/plugins/exec_spec.rb +12 -12
  300. data/spec/components/plugins/form_dicattack_spec.rb +3 -3
  301. data/spec/components/plugins/headers_collector_spec.rb +8 -8
  302. data/spec/components/plugins/healthmap_spec.rb +3 -3
  303. data/spec/components/plugins/http_dicattack_spec.rb +3 -3
  304. data/spec/components/plugins/login_script_spec.rb +79 -22
  305. data/spec/components/plugins/meta/remedies/discovery_spec.rb +3 -2
  306. data/spec/components/plugins/meta/remedies/timing_attacks_spec.rb +3 -3
  307. data/spec/components/plugins/meta/uniformity_spec.rb +2 -2
  308. data/spec/components/plugins/restrict_to_dom_state_spec.rb +1 -1
  309. data/spec/components/plugins/script_spec.rb +1 -1
  310. data/spec/components/plugins/uncommon_headers_spec.rb +2 -2
  311. data/spec/components/plugins/vector_collector_spec.rb +2 -2
  312. data/spec/components/plugins/vector_feed_spec.rb +40 -40
  313. data/spec/components/plugins/waf_detector_spec.rb +6 -6
  314. data/spec/components/reporters/json_spec.rb +4 -4
  315. data/spec/components/reporters/marshal_spec.rb +2 -2
  316. data/spec/components/reporters/yaml_spec.rb +3 -2
  317. data/spec/external/wavsep/active/sqli_spec.rb +1 -3
  318. data/spec/spec_helper.rb +4 -0
  319. data/spec/support/factories/element/ui_form.rb +14 -0
  320. data/spec/support/factories/element/ui_input.rb +13 -0
  321. data/spec/support/factories/issue.rb +0 -13
  322. data/spec/support/fixtures/report.afr +0 -0
  323. data/spec/support/fixtures/{taint_check/taint.rb → signature_check/signature.rb} +2 -2
  324. data/spec/support/helpers/browser_cluster/jobs/taint_tracer.rb +11 -11
  325. data/spec/support/helpers/framework.rb +1 -1
  326. data/spec/support/helpers/pages.rb +2 -2
  327. data/spec/support/servers/arachni/browser.rb +139 -0
  328. data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +40 -0
  329. data/spec/support/servers/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +0 -0
  330. data/spec/support/servers/arachni/element/input/input_dom.rb +102 -0
  331. data/spec/support/servers/arachni/element/ui_form/ui_form_dom.rb +238 -0
  332. data/spec/support/servers/checks/active/trainer_check.rb +7 -7
  333. data/spec/support/servers/checks/active/unvalidated_redirect_dom.rb +22 -6
  334. data/spec/support/servers/checks/active/xss_dom.rb +50 -0
  335. data/spec/support/servers/checks/active/xss_dom_script_context.rb +53 -0
  336. data/spec/support/shared/browser/javascript/taint_tracer/sink/base.rb +6 -6
  337. data/spec/support/shared/check.rb +10 -12
  338. data/spec/support/shared/component/options/base.rb +24 -24
  339. data/spec/support/shared/element/base.rb +25 -25
  340. data/spec/support/shared/element/capabilities/auditable.rb +116 -140
  341. data/spec/support/shared/element/capabilities/dom_only.rb +65 -0
  342. data/spec/support/shared/element/capabilities/inputtable.rb +71 -86
  343. data/spec/support/shared/element/capabilities/mutable.rb +122 -111
  344. data/spec/support/shared/element/capabilities/refreshable.rb +10 -10
  345. data/spec/support/shared/element/capabilities/{submitable.rb → submittable.rb} +26 -26
  346. data/spec/support/shared/element/capabilities/with_auditor.rb +10 -10
  347. data/spec/support/shared/element/capabilities/with_dom.rb +8 -8
  348. data/spec/support/shared/element/capabilities/with_node.rb +4 -6
  349. data/spec/support/shared/element/capabilities/with_scope.rb +2 -2
  350. data/spec/support/shared/element/capabilities/with_source.rb +6 -8
  351. data/spec/support/shared/element/dom.rb +144 -0
  352. data/spec/support/shared/element/dom/auditable.rb +42 -0
  353. data/spec/support/shared/element/dom/inputtable.rb +5 -0
  354. data/spec/support/shared/element/dom/mutable.rb +3 -0
  355. data/spec/support/shared/element/dom/submittable.rb +119 -0
  356. data/spec/support/shared/external/wavsep.rb +3 -3
  357. data/spec/support/shared/fingerprinter.rb +2 -2
  358. data/spec/support/shared/framework.rb +1 -1
  359. data/spec/support/shared/http/message.rb +9 -9
  360. data/spec/support/shared/option_group.rb +17 -17
  361. data/spec/support/shared/path_extractor.rb +1 -1
  362. data/spec/support/shared/plugin.rb +2 -2
  363. data/spec/support/shared/support/cache.rb +57 -57
  364. data/spec/support/shared/support/lookup.rb +25 -25
  365. data/ui/cli/framework.rb +22 -11
  366. data/ui/cli/framework/option_parser.rb +15 -0
  367. data/ui/cli/option_parser.rb +8 -1
  368. data/ui/cli/output.rb +2 -1
  369. metadata +54 -20
  370. data/components/checks/active/xss_dom_inputs.rb +0 -236
  371. data/spec/components/checks/active/xss_dom_inputs_spec.rb +0 -30
  372. data/spec/support/servers/checks/active/xss_dom_inputs.rb +0 -59
  373. data/spec/support/shared/element/capabilities/auditable/dom.rb +0 -322
@@ -13,23 +13,23 @@ describe Arachni::Reporter::Base do
13
13
 
14
14
  describe '#report' do
15
15
  it 'returns the provided report' do
16
- @reporters.run( :with_outfile, report ).report.should == report
16
+ expect(@reporters.run( :with_outfile, report ).report).to eq(report)
17
17
  end
18
18
  end
19
19
 
20
20
  describe '#outfile' do
21
21
  it 'returns the outfile in options' do
22
22
  outfile = 'blahfile'
23
- @reporters.run( :with_outfile, @framework.report,
23
+ expect(@reporters.run( :with_outfile, @framework.report,
24
24
  'outfile' => outfile
25
- ).outfile.should == outfile
25
+ ).outfile).to eq(outfile)
26
26
  end
27
27
 
28
28
  context 'when a directory is provided as an outfile option' do
29
29
  it 'returns the path of default outfile filename under that directory' do
30
- @reporters.run( :with_outfile, @framework.report,
30
+ expect(@reporters.run( :with_outfile, @framework.report,
31
31
  'outfile' => '.'
32
- ).outfile.start_with?( File.expand_path( "." ) ).should be_true
32
+ ).outfile.start_with?( File.expand_path( "." ) )).to be_truthy
33
33
  end
34
34
  end
35
35
  end
@@ -38,25 +38,25 @@ describe Arachni::Reporter::Base do
38
38
  context 'when the :skip_responses option is' do
39
39
  context true do
40
40
  it 'returns true' do
41
- described_class.new(
41
+ expect(described_class.new(
42
42
  report,
43
43
  skip_responses: true
44
- ).skip_responses?.should be_true
44
+ ).skip_responses?).to be_truthy
45
45
  end
46
46
  end
47
47
 
48
48
  context false do
49
49
  it 'returns false' do
50
- described_class.new(
50
+ expect(described_class.new(
51
51
  report,
52
52
  skip_responses: false
53
- ).skip_responses?.should be_false
53
+ ).skip_responses?).to be_falsey
54
54
  end
55
55
  end
56
56
 
57
57
  context 'not set' do
58
58
  it 'returns false' do
59
- described_class.new( report, {} ).skip_responses?.should be_false
59
+ expect(described_class.new( report, {} ).skip_responses?).to be_falsey
60
60
  end
61
61
  end
62
62
  end
@@ -68,7 +68,7 @@ describe Arachni::Reporter::Base do
68
68
  store.plugins[:foobar] = { results: 'Blah!' }
69
69
 
70
70
  @reporters.run( 'with_formatters', store )
71
- IO.read( 'with_formatters' ).should == { foobar: 'Blah!' }.to_s
71
+ expect(IO.read( 'with_formatters' )).to eq({ foobar: 'Blah!' }.to_s)
72
72
  File.delete( 'with_formatters' )
73
73
  end
74
74
  end
@@ -76,20 +76,20 @@ describe Arachni::Reporter::Base do
76
76
  describe '.has_outfile?' do
77
77
  context 'when the reporter has an outfile option' do
78
78
  it 'returns true' do
79
- @reporters[:with_outfile].has_outfile?.should be_true
79
+ expect(@reporters[:with_outfile].has_outfile?).to be_truthy
80
80
  end
81
81
  end
82
82
  context 'when the reporter does not have an outfile option' do
83
83
  it 'returns false' do
84
- @reporters[:without_outfile].has_outfile?.should be_false
84
+ expect(@reporters[:without_outfile].has_outfile?).to be_falsey
85
85
  end
86
86
  end
87
87
  end
88
88
 
89
89
  describe '#has_outfile?' do
90
90
  it "delegates to #{described_class}.has_outfile?" do
91
- described_class.stub(:has_outfile?) { :stuff }
92
- described_class.new( report, {} ).has_outfile?.should == :stuff
91
+ allow(described_class).to receive(:has_outfile?) { :stuff }
92
+ expect(described_class.new( report, {} ).has_outfile?).to eq(:stuff)
93
93
  end
94
94
  end
95
95
 
@@ -15,7 +15,7 @@ describe Arachni::Reporter::Manager do
15
15
  it 'runs a reporter by name' do
16
16
  @reporters.run( 'foo', report )
17
17
 
18
- File.exist?( 'foo' ).should be_true
18
+ expect(File.exist?( 'foo' )).to be_truthy
19
19
  end
20
20
 
21
21
  context 'when options are given' do
@@ -23,7 +23,7 @@ describe Arachni::Reporter::Manager do
23
23
  options = { 'outfile' => 'stuff' }
24
24
  reporter = @reporters.run( :foo, report, options )
25
25
 
26
- reporter.options.should == options.my_symbolize_keys(false)
26
+ expect(reporter.options).to eq(options.my_symbolize_keys(false))
27
27
  end
28
28
  end
29
29
 
@@ -56,8 +56,8 @@ describe Arachni::Reporter::Manager do
56
56
 
57
57
  describe '#reset' do
58
58
  it "delegates to #{described_class}.reset" do
59
- described_class.stub(:reset) { :stuff }
60
- @reporters.reset.should == :stuff
59
+ allow(described_class).to receive(:reset) { :stuff }
60
+ expect(@reporters.reset).to eq(:stuff)
61
61
  end
62
62
  end
63
63
 
@@ -9,11 +9,11 @@ describe Arachni::Reporter::Options do
9
9
 
10
10
  describe '#outfile' do
11
11
  it 'returns an :outfile reporter option' do
12
- subject.outfile.name.should == :outfile
12
+ expect(subject.outfile.name).to eq(:outfile)
13
13
  end
14
14
 
15
15
  it 'has a default value' do
16
- subject.outfile.default.should be_true
16
+ expect(subject.outfile.default).to be_truthy
17
17
  end
18
18
 
19
19
  context 'when given an extension' do
@@ -26,22 +26,22 @@ describe Arachni::Reporter::Options do
26
26
  context 'when given a description' do
27
27
  it 'assigns it to the option' do
28
28
  description = 'My description'
29
- subject.outfile( '', description ).description.should == description
29
+ expect(subject.outfile( '', description ).description).to eq(description)
30
30
  end
31
31
  end
32
32
  end
33
33
 
34
34
  describe '#skip_responses' do
35
35
  it 'returns a :skip_responses reporter option' do
36
- subject.skip_responses.name.should == :skip_responses
36
+ expect(subject.skip_responses.name).to eq(:skip_responses)
37
37
  end
38
38
 
39
39
  it "defaults to 'false'" do
40
- subject.skip_responses.default.should == false
40
+ expect(subject.skip_responses.default).to eq(false)
41
41
  end
42
42
 
43
43
  it 'has a description' do
44
- subject.skip_responses.description.should be_true
44
+ expect(subject.skip_responses.description).to be_truthy
45
45
  end
46
46
  end
47
47
 
@@ -54,7 +54,7 @@ describe Arachni::RPC::Client::Base do
54
54
  it 'connects to a server' do
55
55
  Server.new( options ) do |server|
56
56
  client = described_class.new( options, server.url )
57
- client.call( "foo.bar" ).should == true
57
+ expect(client.call( "foo.bar" )).to eq(true)
58
58
  end
59
59
  end
60
60
  end
@@ -64,7 +64,7 @@ describe Arachni::RPC::Client::Base do
64
64
  it 'connects successfully' do
65
65
  Server.new( ssl_options ) do |server|
66
66
  client = described_class.new( ssl_options, server.url )
67
- client.call( "foo.bar" ).should be_true
67
+ expect(client.call( "foo.bar" )).to be_truthy
68
68
  end
69
69
  end
70
70
  end
@@ -83,7 +83,7 @@ describe Arachni::RPC::Client::Base do
83
83
  raised = true
84
84
  end
85
85
 
86
- raised.should be_true
86
+ expect(raised).to be_truthy
87
87
  end
88
88
  end
89
89
  end
@@ -106,7 +106,7 @@ describe Arachni::RPC::Client::Base do
106
106
  raised = true
107
107
  end
108
108
 
109
- raised.should be_true
109
+ expect(raised).to be_truthy
110
110
  end
111
111
  end
112
112
  end
@@ -121,7 +121,7 @@ describe Arachni::RPC::Client::Base do
121
121
 
122
122
  Server.new( opts, token ) do |server|
123
123
  client = described_class.new( opts, server.url, token )
124
- client.call( "foo.bar" ).should be_true
124
+ expect(client.call( "foo.bar" )).to be_truthy
125
125
  end
126
126
  end
127
127
  end
@@ -140,7 +140,7 @@ describe Arachni::RPC::Client::Base do
140
140
  raised = true
141
141
  end
142
142
 
143
- raised.should be_true
143
+ expect(raised).to be_truthy
144
144
  end
145
145
  end
146
146
  end
@@ -13,12 +13,12 @@ describe Arachni::RPC::Client::Dispatcher do
13
13
 
14
14
  it 'maps the remote handlers to local objects' do
15
15
  args = [ 'stuff', 'here', { 'blah' => true } ]
16
- @dispatcher.echo.echo( *args ).should == args
16
+ expect(@dispatcher.echo.echo( *args )).to eq(args)
17
17
  end
18
18
 
19
19
  describe '#node' do
20
20
  it 'provides access to the node data' do
21
- @dispatcher.node.info.is_a?( Hash ).should be_true
21
+ expect(@dispatcher.node.info.is_a?( Hash )).to be_truthy
22
22
  end
23
23
  end
24
24
 
@@ -12,7 +12,7 @@ describe Arachni::RPC::Client::Instance do
12
12
  context 'which requires a token' do
13
13
  context 'with a valid token' do
14
14
  it 'connects successfully' do
15
- @instance.service.alive?.should be_true
15
+ expect(@instance.service.alive?).to be_truthy
16
16
  end
17
17
  end
18
18
 
@@ -35,8 +35,8 @@ describe Arachni::RPC::Client::Instance do
35
35
  describe '#set' do
36
36
  it 'allows batch assigning using a hash' do
37
37
  val = @foo_url + '3'
38
- @rpc_opts.set( url: val ).should be_true
39
- @rpc_opts.url.to_s.should == val
38
+ expect(@rpc_opts.set( url: val )).to be_truthy
39
+ expect(@rpc_opts.url.to_s).to eq(val)
40
40
  end
41
41
  end
42
42
  end
@@ -44,21 +44,21 @@ describe Arachni::RPC::Client::Instance do
44
44
  describe '#framework' do
45
45
  before { @framework = @instance.framework }
46
46
  it 'provides access to framework methods' do
47
- @framework.status.should be_true
47
+ expect(@framework.status).to be_truthy
48
48
  end
49
49
  end
50
50
 
51
51
  describe '#checks' do
52
52
  before { @checks = @instance.checks }
53
53
  it 'provides access to checks manager methods' do
54
- @checks.available.should be_true
54
+ expect(@checks.available).to be_truthy
55
55
  end
56
56
  end
57
57
 
58
58
  describe '#plugins' do
59
59
  before { @plugins = @instance.plugins }
60
60
  it 'provides access to plugin manager methods' do
61
- @plugins.available.should be_true
61
+ expect(@plugins.available).to be_truthy
62
62
  end
63
63
  end
64
64
 
@@ -13,7 +13,7 @@ describe Arachni::RPC::Server::ActiveOptions do
13
13
 
14
14
  describe '#set' do
15
15
  it 'sets options by hash' do
16
- @instance.service.cookies.should be_empty
16
+ expect(@instance.service.cookies).to be_empty
17
17
 
18
18
  opts = {
19
19
  'url' => 'http://blah.com',
@@ -35,23 +35,26 @@ describe Arachni::RPC::Server::ActiveOptions do
35
35
  @instance.options.set( opts )
36
36
  h = @instance.options.to_h
37
37
 
38
- h['url'].to_s.should == @utils.normalize_url( opts['url'] )
39
- h['scope']['exclude_path_patterns'].should ==
38
+ expect(h['url'].to_s).to eq(@utils.normalize_url( opts['url'] ))
39
+ expect(h['scope']['exclude_path_patterns']).to eq(
40
40
  opts['scope']['exclude_path_patterns'].map { |s| Regexp.new(s).to_s }
41
- h['scope']['include_path_patterns'].should ==
41
+ )
42
+ expect(h['scope']['include_path_patterns']).to eq(
42
43
  opts['scope']['include_path_patterns'].map { |s| Regexp.new(s).to_s }
43
- h['scope']['redundant_path_patterns'].should ==
44
+ )
45
+ expect(h['scope']['redundant_path_patterns']).to eq(
44
46
  opts['scope']['redundant_path_patterns'].
45
47
  inject({}) { |hh, (k, v)| hh[Regexp.new(k).to_s] = v.to_s; hh }
48
+ )
46
49
 
47
- h['datastore'].should == opts['datastore']
50
+ expect(h['datastore']).to eq(opts['datastore'])
48
51
 
49
- @instance.service.cookies.map { |c| Arachni::Cookie.from_rpc_data c }.should == [
52
+ expect(@instance.service.cookies.map { |c| Arachni::Cookie.from_rpc_data c }).to eq([
50
53
  Arachni::Cookie.new( url: opts['url'], inputs: { 'name' => 'value' } ),
51
54
  Arachni::Cookie.new( url: opts['url'], inputs: { 'name2' => 'value2' } ),
52
55
  Arachni::Cookie.new( url: opts['url'], inputs: { 'name3' => 'value3' } ),
53
56
  Arachni::Cookie.new( url: opts['url'], inputs: { 'name4' => 'value4' } )
54
- ]
57
+ ])
55
58
  end
56
59
  end
57
60
  end
@@ -29,14 +29,14 @@ describe Arachni::RPC::Server::Base do
29
29
  raised = true
30
30
  end
31
31
 
32
- server.ready?.should be_true
33
- raised.should be_false
32
+ expect(server.ready?).to be_truthy
33
+ expect(raised).to be_falsey
34
34
  end
35
35
 
36
36
  describe '#ready?' do
37
37
  context 'when the server is not ready' do
38
38
  it 'returns false' do
39
- @server.ready?.should be_false
39
+ expect(@server.ready?).to be_falsey
40
40
  end
41
41
  end
42
42
 
@@ -53,8 +53,8 @@ describe Arachni::RPC::Server::Base do
53
53
  raised = true
54
54
  end
55
55
 
56
- @server.ready?.should be_true
57
- raised.should be_false
56
+ expect(@server.ready?).to be_truthy
57
+ expect(raised).to be_falsey
58
58
  end
59
59
  end
60
60
  end
@@ -4,23 +4,23 @@ require Arachni::Options.paths.lib + 'rpc/server/framework'
4
4
  describe Arachni::RPC::Server::Check::Manager do
5
5
  describe '#available' do
6
6
  it 'returns an array of available checks' do
7
- instance_spawn.checks.available.should be_any
7
+ expect(instance_spawn.checks.available).to be_any
8
8
  end
9
9
  end
10
10
 
11
11
  describe '#loaded' do
12
12
  context 'when there are loaded checks' do
13
13
  it 'returns an empty array' do
14
- instance_spawn.checks.loaded.should be_empty
14
+ expect(instance_spawn.checks.loaded).to be_empty
15
15
  end
16
16
  end
17
17
  context 'when there are loaded checks' do
18
18
  it 'returns an array of loaded checks' do
19
19
  checks = instance_spawn.checks
20
20
 
21
- checks.loaded.should be_empty
21
+ expect(checks.loaded).to be_empty
22
22
  checks.load '*'
23
- checks.loaded.should be_any
23
+ expect(checks.loaded).to be_any
24
24
  end
25
25
  end
26
26
  end
@@ -29,9 +29,9 @@ describe Arachni::RPC::Server::Check::Manager do
29
29
  it 'loads checks by name' do
30
30
  checks = instance_spawn.checks
31
31
 
32
- checks.loaded.should be_empty
32
+ expect(checks.loaded).to be_empty
33
33
  checks.load 'test'
34
- checks.loaded.should == ['test']
34
+ expect(checks.loaded).to eq(['test'])
35
35
  end
36
36
  end
37
37
 
@@ -39,9 +39,9 @@ describe Arachni::RPC::Server::Check::Manager do
39
39
  it 'loads all checks' do
40
40
  checks = instance_spawn.checks
41
41
 
42
- checks.loaded.should be_empty
42
+ expect(checks.loaded).to be_empty
43
43
  checks.load_all
44
- checks.loaded.should == checks.available
44
+ expect(checks.loaded).to eq(checks.available)
45
45
  end
46
46
  end
47
47
 
@@ -44,13 +44,13 @@ describe Arachni::RPC::Server::Dispatcher::Node do
44
44
  options.dispatcher.neighbour = nil
45
45
  sleep 4
46
46
 
47
- c.grid_member?.should be_true
47
+ expect(c.grid_member?).to be_truthy
48
48
  end
49
49
  end
50
50
 
51
51
  context 'when the dispatcher is not a grid member' do
52
52
  it 'should return false' do
53
- @node.grid_member?.should be_false
53
+ expect(@node.grid_member?).to be_falsey
54
54
  end
55
55
  end
56
56
  end
@@ -71,13 +71,13 @@ describe Arachni::RPC::Server::Dispatcher::Node do
71
71
  n.add_neighbour( '127.0.0.1:' + port.to_s )
72
72
 
73
73
  sleep 4
74
- n.neighbours.should be_empty
74
+ expect(n.neighbours).to be_empty
75
75
 
76
76
  c = @get_node.call( port )
77
77
 
78
78
  sleep 4
79
- n.neighbours.should == [c.url]
80
- c.neighbours.should == [n.url]
79
+ expect(n.neighbours).to eq([c.url])
80
+ expect(c.neighbours).to eq([n.url])
81
81
 
82
82
  options.dispatcher.neighbour = nil
83
83
  end
@@ -99,14 +99,14 @@ describe Arachni::RPC::Server::Dispatcher::Node do
99
99
  n.add_neighbour( c.url )
100
100
  sleep 1
101
101
 
102
- c.neighbours.should == [n.url]
103
- n.neighbours.should == [c.url]
102
+ expect(c.neighbours).to eq([n.url])
103
+ expect(n.neighbours).to eq([c.url])
104
104
 
105
105
  n.shutdown rescue Arachni::RPC::Exceptions::ConnectionError
106
106
 
107
107
  sleep 4
108
108
 
109
- c.neighbours.should be_empty
109
+ expect(c.neighbours).to be_empty
110
110
  end
111
111
  end
112
112
 
@@ -117,22 +117,22 @@ describe Arachni::RPC::Server::Dispatcher::Node do
117
117
  options.dispatcher.neighbour = n.url
118
118
  c = @get_node.call
119
119
  sleep 4
120
- c.neighbours.should == [n.url]
121
- n.neighbours.should == [c.url]
120
+ expect(c.neighbours).to eq([n.url])
121
+ expect(n.neighbours).to eq([c.url])
122
122
 
123
123
  d = @get_node.call
124
124
  sleep 4
125
- d.neighbours.sort.should == [n.url, c.url].sort
126
- c.neighbours.sort.should == [n.url, d.url].sort
127
- n.neighbours.sort.should == [c.url, d.url].sort
125
+ expect(d.neighbours.sort).to eq([n.url, c.url].sort)
126
+ expect(c.neighbours.sort).to eq([n.url, d.url].sort)
127
+ expect(n.neighbours.sort).to eq([c.url, d.url].sort)
128
128
 
129
129
  options.dispatcher.neighbour = d.url
130
130
  e = @get_node.call
131
131
  sleep 4
132
- e.neighbours.sort.should == [n.url, c.url, d.url].sort
133
- d.neighbours.sort.should == [n.url, c.url, e.url].sort
134
- c.neighbours.sort.should == [n.url, d.url, e.url].sort
135
- n.neighbours.sort.should == [c.url, d.url, e.url].sort
132
+ expect(e.neighbours.sort).to eq([n.url, c.url, d.url].sort)
133
+ expect(d.neighbours.sort).to eq([n.url, c.url, e.url].sort)
134
+ expect(c.neighbours.sort).to eq([n.url, d.url, e.url].sort)
135
+ expect(n.neighbours.sort).to eq([c.url, d.url, e.url].sort)
136
136
 
137
137
  options.dispatcher.neighbour = nil
138
138
  end
@@ -145,8 +145,8 @@ describe Arachni::RPC::Server::Dispatcher::Node do
145
145
  it 'adds a neighbour' do
146
146
  @node.add_neighbour( @n.url )
147
147
  sleep 0.5
148
- @node.neighbours.should == [@n.url]
149
- @n.neighbours.should == [@node.url]
148
+ expect(@node.neighbours).to eq([@n.url])
149
+ expect(@n.neighbours).to eq([@node.url])
150
150
  end
151
151
  context 'when propagate is set to true' do
152
152
  it 'announces the new neighbour to the existing neighbours' do
@@ -154,32 +154,32 @@ describe Arachni::RPC::Server::Dispatcher::Node do
154
154
  @node.add_neighbour( n.url, true )
155
155
  sleep 0.5
156
156
 
157
- @node.neighbours.sort.should == [@n.url, n.url].sort
158
- @n.neighbours.sort.should == [@node.url, n.url].sort
157
+ expect(@node.neighbours.sort).to eq([@n.url, n.url].sort)
158
+ expect(@n.neighbours.sort).to eq([@node.url, n.url].sort)
159
159
 
160
160
  c = @get_node.call
161
161
  n.add_neighbour( c.url, true )
162
162
  sleep 0.5
163
163
 
164
- @node.neighbours.sort.should == [@n.url, n.url, c.url].sort
165
- @n.neighbours.sort.should == [@node.url, n.url, c.url].sort
166
- c.neighbours.sort.should == [@node.url, n.url, @n.url].sort
164
+ expect(@node.neighbours.sort).to eq([@n.url, n.url, c.url].sort)
165
+ expect(@n.neighbours.sort).to eq([@node.url, n.url, c.url].sort)
166
+ expect(c.neighbours.sort).to eq([@node.url, n.url, @n.url].sort)
167
167
 
168
168
  d = @get_node.call
169
169
  d.add_neighbour( c.url, true )
170
170
  sleep 0.5
171
171
 
172
- @node.neighbours.sort.should == [d.url, @n.url, n.url, c.url].sort
173
- @n.neighbours.sort.should == [d.url, @node.url, n.url, c.url].sort
174
- c.neighbours.sort.should == [d.url, @node.url, n.url, @n.url].sort
175
- d.neighbours.sort.should == [c.url, @node.url, n.url, @n.url].sort
172
+ expect(@node.neighbours.sort).to eq([d.url, @n.url, n.url, c.url].sort)
173
+ expect(@n.neighbours.sort).to eq([d.url, @node.url, n.url, c.url].sort)
174
+ expect(c.neighbours.sort).to eq([d.url, @node.url, n.url, @n.url].sort)
175
+ expect(d.neighbours.sort).to eq([c.url, @node.url, n.url, @n.url].sort)
176
176
  end
177
177
  end
178
178
  end
179
179
 
180
180
  describe '#neighbours' do
181
181
  it 'returns an array of neighbours' do
182
- @node.neighbours.is_a?( Array ).should be_true
182
+ expect(@node.neighbours.is_a?( Array )).to be_truthy
183
183
  end
184
184
  end
185
185
 
@@ -188,7 +188,7 @@ describe Arachni::RPC::Server::Dispatcher::Node do
188
188
  @node.neighbours_with_info.size == @node.neighbours.size
189
189
  keys = @node.info.keys.sort
190
190
  @node.neighbours_with_info.each do |i|
191
- i.keys.sort.should == keys
191
+ expect(i.keys.sort).to eq(keys)
192
192
  end
193
193
  end
194
194
  end
@@ -203,24 +203,24 @@ describe Arachni::RPC::Server::Dispatcher::Node do
203
203
  n = @get_node.call
204
204
  info = n.info
205
205
 
206
- info['url'].should == n.url
207
- info['pipe_id'].should == options.dispatcher.node_pipe_id
208
- info['weight'].should == options.dispatcher.node_weight
209
- info['nickname'].should == options.dispatcher.node_nickname
210
- info['cost'].should == options.dispatcher.node_cost
206
+ expect(info['url']).to eq(n.url)
207
+ expect(info['pipe_id']).to eq(options.dispatcher.node_pipe_id)
208
+ expect(info['weight']).to eq(options.dispatcher.node_weight)
209
+ expect(info['nickname']).to eq(options.dispatcher.node_nickname)
210
+ expect(info['cost']).to eq(options.dispatcher.node_cost)
211
211
  end
212
212
 
213
213
  context 'when Options#dispatcher_external_address has been set' do
214
214
  it 'advertises that address' do
215
215
  options.dispatcher.external_address = '9.9.9.9'
216
- @get_node.call.info['url'].should start_with options.dispatcher.external_address
216
+ expect(@get_node.call.info['url']).to start_with options.dispatcher.external_address
217
217
  end
218
218
  end
219
219
  end
220
220
 
221
221
  describe '#alive?' do
222
222
  it 'returns true' do
223
- @get_node.call.alive?.should be_true
223
+ expect(@get_node.call.alive?).to be_truthy
224
224
  end
225
225
  end
226
226
  end