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
@@ -21,34 +21,34 @@ describe Arachni::Check::Base do
21
21
 
22
22
  describe '#session' do
23
23
  it "returns #{Arachni::Framework}#session" do
24
- subject.session.should == framework.session
24
+ expect(subject.session).to eq(framework.session)
25
25
  end
26
26
  end
27
27
 
28
28
  describe '#plugins' do
29
29
  it "returns #{Arachni::Framework}#plugins" do
30
- subject.plugins.should == framework.plugins
30
+ expect(subject.plugins).to eq(framework.plugins)
31
31
  end
32
32
  end
33
33
 
34
34
  describe '#has_platforms?' do
35
35
  context 'when platforms are provided' do
36
36
  before do
37
- described_class.stub(:info) { { platforms: [ :unix ] } }
37
+ allow(described_class).to receive(:info) { { platforms: [ :unix ] } }
38
38
  end
39
39
 
40
40
  it 'returns true' do
41
- described_class.has_platforms?.should be_true
41
+ expect(described_class.has_platforms?).to be_truthy
42
42
  end
43
43
  end
44
44
 
45
45
  context 'when platforms are not provided' do
46
46
  before do
47
- described_class.stub(:info) { { platforms: [] } }
47
+ allow(described_class).to receive(:info) { { platforms: [] } }
48
48
  end
49
49
 
50
50
  it 'returns false' do
51
- described_class.has_platforms?.should be_false
51
+ expect(described_class.has_platforms?).to be_falsey
52
52
  end
53
53
  end
54
54
  end
@@ -56,21 +56,21 @@ describe Arachni::Check::Base do
56
56
  describe '#has_exempt_platforms?' do
57
57
  context 'when exempt platforms are provided' do
58
58
  before do
59
- described_class.stub(:info) { { exempt_platforms: [ :unix ] } }
59
+ allow(described_class).to receive(:info) { { exempt_platforms: [ :unix ] } }
60
60
  end
61
61
 
62
62
  it 'returns true' do
63
- described_class.has_exempt_platforms?.should be_true
63
+ expect(described_class.has_exempt_platforms?).to be_truthy
64
64
  end
65
65
  end
66
66
 
67
67
  context 'when exempt platforms are not provided' do
68
68
  before do
69
- described_class.stub(:info) { { exempt_platforms: [] } }
69
+ allow(described_class).to receive(:info) { { exempt_platforms: [] } }
70
70
  end
71
71
 
72
72
  it 'returns false' do
73
- described_class.has_exempt_platforms?.should be_false
73
+ expect(described_class.has_exempt_platforms?).to be_falsey
74
74
  end
75
75
  end
76
76
  end
@@ -78,118 +78,118 @@ describe Arachni::Check::Base do
78
78
  describe '#supports_platforms?' do
79
79
  context 'when empty platforms are given' do
80
80
  it 'returns true' do
81
- described_class.supports_platforms?([]).should be_true
81
+ expect(described_class.supports_platforms?([])).to be_truthy
82
82
  end
83
83
  end
84
84
 
85
85
  context 'when no supported platforms are declared' do
86
86
  before do
87
- described_class.stub(:info) { { platforms: [] } }
87
+ allow(described_class).to receive(:info) { { platforms: [] } }
88
88
  end
89
89
 
90
90
  it 'returns true' do
91
- described_class.supports_platforms?([]).should be_true
91
+ expect(described_class.supports_platforms?([])).to be_truthy
92
92
  end
93
93
  end
94
94
 
95
95
  context 'when any of the given platforms are supported' do
96
96
  before do
97
- described_class.stub(:info) { { platforms: [:php] } }
97
+ allow(described_class).to receive(:info) { { platforms: [:php] } }
98
98
  end
99
99
 
100
100
  it 'returns true' do
101
- described_class.supports_platforms?([:unix, :php]).should be_true
101
+ expect(described_class.supports_platforms?([:unix, :php])).to be_truthy
102
102
  end
103
103
  end
104
104
 
105
105
  context 'when any of the given platforms are exempt' do
106
106
  before do
107
- described_class.stub(:info) { { exempt_platforms: [:php] } }
107
+ allow(described_class).to receive(:info) { { exempt_platforms: [:php] } }
108
108
  end
109
109
 
110
110
  it 'returns false' do
111
- described_class.supports_platforms?([:unix, :php]).should be_false
111
+ expect(described_class.supports_platforms?([:unix, :php])).to be_falsey
112
112
  end
113
113
  end
114
114
 
115
115
  context 'when a parent of any of the given platforms is supported' do
116
116
  before do
117
- described_class.stub(:info) { { platforms: [:unix] } }
117
+ allow(described_class).to receive(:info) { { platforms: [:unix] } }
118
118
  end
119
119
 
120
120
  it 'returns true' do
121
- described_class.supports_platforms?([:linux]).should be_true
121
+ expect(described_class.supports_platforms?([:linux])).to be_truthy
122
122
  end
123
123
  end
124
124
 
125
125
  context 'when a parent of any of the given platforms is exempt' do
126
126
  before do
127
- described_class.stub(:info) { { exempt_platforms: [:unix] } }
127
+ allow(described_class).to receive(:info) { { exempt_platforms: [:unix] } }
128
128
  end
129
129
 
130
130
  it 'returns false' do
131
- described_class.supports_platforms?([:linux]).should be_false
131
+ expect(described_class.supports_platforms?([:linux])).to be_falsey
132
132
  end
133
133
  end
134
134
 
135
135
 
136
136
  context 'when a child of any of the given platforms is supported' do
137
137
  before do
138
- described_class.stub(:info) { { platforms: [:linux] } }
138
+ allow(described_class).to receive(:info) { { platforms: [:linux] } }
139
139
  end
140
140
 
141
141
  it 'returns true' do
142
- described_class.supports_platforms?([:unix]).should be_true
142
+ expect(described_class.supports_platforms?([:unix])).to be_truthy
143
143
  end
144
144
  end
145
145
 
146
146
  context 'when a child of any of the given platforms is exempt' do
147
147
  before do
148
- described_class.stub(:info) { { exempt_platforms: [:linux] } }
148
+ allow(described_class).to receive(:info) { { exempt_platforms: [:linux] } }
149
149
  end
150
150
 
151
151
  it 'returns false' do
152
- described_class.supports_platforms?([:unix]).should be_false
152
+ expect(described_class.supports_platforms?([:unix])).to be_falsey
153
153
  end
154
154
  end
155
155
 
156
156
  context 'when none of the given platforms are not provided' do
157
157
  before do
158
- described_class.stub(:info) { { platforms: [:windows] } }
158
+ allow(described_class).to receive(:info) { { platforms: [:windows] } }
159
159
  end
160
160
 
161
161
  it 'returns false' do
162
- described_class.supports_platforms?([:unix]).should be_false
162
+ expect(described_class.supports_platforms?([:unix])).to be_falsey
163
163
  end
164
164
  end
165
165
 
166
166
  context 'when none of the given platforms are exempt' do
167
167
  before do
168
- described_class.stub(:info) { { exempt_platforms: [:windows] } }
168
+ allow(described_class).to receive(:info) { { exempt_platforms: [:windows] } }
169
169
  end
170
170
 
171
171
  it 'returns true' do
172
- described_class.supports_platforms?([:unix]).should be_true
172
+ expect(described_class.supports_platforms?([:unix])).to be_truthy
173
173
  end
174
174
  end
175
175
 
176
176
  context 'when any of the given platforms are exempt' do
177
177
  before do
178
- described_class.stub(:info) { { exempt_platforms: [:windows, :linux] } }
178
+ allow(described_class).to receive(:info) { { exempt_platforms: [:windows, :linux] } }
179
179
  end
180
180
 
181
181
  it 'returns false' do
182
- described_class.supports_platforms?([:unix]).should be_false
182
+ expect(described_class.supports_platforms?([:unix])).to be_falsey
183
183
  end
184
184
  end
185
185
 
186
186
  context 'when a platforms of different type is exempt' do
187
187
  before do
188
- described_class.stub(:info) { { exempt_platforms: [:windows] } }
188
+ allow(described_class).to receive(:info) { { exempt_platforms: [:windows] } }
189
189
  end
190
190
 
191
191
  it 'returns true' do
192
- described_class.supports_platforms?([:ruby]).should be_true
192
+ expect(described_class.supports_platforms?([:ruby])).to be_truthy
193
193
  end
194
194
  end
195
195
 
@@ -20,8 +20,8 @@ describe Arachni::Check::Manager do
20
20
  describe '#load' do
21
21
  it 'loads all checks' do
22
22
  all = checks.load_all
23
- all.size.should equal 3
24
- all.sort.should == checks.keys.sort
23
+ expect(all.size).to equal 3
24
+ expect(all.sort).to eq(checks.keys.sort)
25
25
  end
26
26
  end
27
27
 
@@ -35,7 +35,7 @@ describe Arachni::Check::Manager do
35
35
  checks = Arachni::Framework.new.checks
36
36
 
37
37
  expect { checks[:with_invalid_platforms] }.to raise_error described_class::Error::InvalidPlatforms
38
- checks.include?(:with_invalid_platforms).should be_false
38
+ expect(checks.include?(:with_invalid_platforms)).to be_falsey
39
39
  end
40
40
  end
41
41
  end
@@ -46,36 +46,36 @@ describe Arachni::Check::Manager do
46
46
  checks.load :test2
47
47
  checks.load :test3
48
48
  checks.load :test
49
- checks.schedule.should == [checks[:test], checks[:test2], checks[:test3]]
49
+ expect(checks.schedule).to eq([checks[:test], checks[:test2], checks[:test3]])
50
50
 
51
51
  checks.clear
52
52
 
53
53
  checks.load :test2
54
- checks.schedule.should == [checks[:test2]]
54
+ expect(checks.schedule).to eq([checks[:test2]])
55
55
 
56
56
  checks.clear
57
57
 
58
58
  checks.load :test
59
- checks.schedule.should == [checks[:test]]
59
+ expect(checks.schedule).to eq([checks[:test]])
60
60
 
61
61
  checks.clear
62
62
 
63
63
  checks.load :test, :test3
64
- checks.schedule.should == [checks[:test], checks[:test3]]
64
+ expect(checks.schedule).to eq([checks[:test], checks[:test3]])
65
65
  end
66
66
  end
67
67
 
68
68
  describe '#with_platforms' do
69
69
  it 'returns checks which target specific platforms' do
70
70
  checks.load_all
71
- checks.with_platforms.keys.should == ['test2']
71
+ expect(checks.with_platforms.keys).to eq(['test2'])
72
72
  end
73
73
  end
74
74
 
75
75
  describe '#without_platforms' do
76
76
  it 'returns checks which do not target specific platforms' do
77
77
  checks.load_all
78
- checks.without_platforms.keys.sort.should == %w(test test3).sort
78
+ expect(checks.without_platforms.keys.sort).to eq(%w(test test3).sort)
79
79
  end
80
80
  end
81
81
 
@@ -83,8 +83,8 @@ describe Arachni::Check::Manager do
83
83
  it 'runs all checks' do
84
84
  checks.load_all
85
85
  checks.run( page )
86
- issues.size.should equal 1
87
- issues.first.name.should == checks['test'].info[:issue][:name]
86
+ expect(issues.size).to equal 1
87
+ expect(issues.first.name).to eq(checks['test'].info[:issue][:name])
88
88
  end
89
89
  end
90
90
 
@@ -92,14 +92,14 @@ describe Arachni::Check::Manager do
92
92
  it 'runs a single check' do
93
93
  checks.load :test
94
94
  checks.run_one( checks.values.first, page )
95
- issues.size.should equal 1
96
- issues.first.name.should == checks['test'].info[:issue][:name]
95
+ expect(issues.size).to equal 1
96
+ expect(issues.first.name).to eq(checks['test'].info[:issue][:name])
97
97
  end
98
98
 
99
99
  context 'when the check was ran' do
100
100
  it 'returns true' do
101
101
  checks.load :test
102
- checks.run_one( checks.values.first, page ).should be_true
102
+ expect(checks.run_one( checks.values.first, page )).to be_truthy
103
103
  end
104
104
  end
105
105
 
@@ -109,7 +109,7 @@ describe Arachni::Check::Manager do
109
109
 
110
110
  allow(Arachni::Checks::Test).to receive(:check?).and_return(false)
111
111
 
112
- checks.run_one( checks.values.first, page ).should be_false
112
+ expect(checks.run_one( checks.values.first, page )).to be_falsey
113
113
  end
114
114
  end
115
115
  end
@@ -18,46 +18,46 @@ describe Arachni::Component::Base do
18
18
  let(:info) { Subject.info }
19
19
 
20
20
  it "includes #{Arachni::Component::Output}" do
21
- subject.should include Arachni::Component::Output
21
+ expect(subject).to include Arachni::Component::Output
22
22
  end
23
23
 
24
24
  it "includes #{Arachni::Component::Utilities}" do
25
- subject.should include Arachni::Component::Utilities
25
+ expect(subject).to include Arachni::Component::Utilities
26
26
  end
27
27
 
28
28
  describe '.shortname=' do
29
29
  it 'sets the .shortname' do
30
30
  subject.shortname = :blah
31
- subject.shortname.should == :blah
31
+ expect(subject.shortname).to eq(:blah)
32
32
  end
33
33
 
34
34
  it 'sets the #shortname' do
35
35
  subject.shortname = :blah
36
- subject.new.shortname.should == :blah
36
+ expect(subject.new.shortname).to eq(:blah)
37
37
  end
38
38
  end
39
39
 
40
40
  describe '.fullname' do
41
41
  it 'returns the name' do
42
- subject.fullname.should == info[:name]
42
+ expect(subject.fullname).to eq(info[:name])
43
43
  end
44
44
  end
45
45
 
46
46
  describe '.description' do
47
47
  it 'returns the description' do
48
- subject.description.should == info[:description]
48
+ expect(subject.description).to eq(info[:description])
49
49
  end
50
50
  end
51
51
 
52
52
  describe '.author' do
53
53
  it 'returns the author' do
54
- subject.author.should == info[:author]
54
+ expect(subject.author).to eq(info[:author])
55
55
  end
56
56
  end
57
57
 
58
58
  describe '.version' do
59
59
  it 'returns the version' do
60
- subject.version.should == info[:version]
60
+ expect(subject.version).to eq(info[:version])
61
61
  end
62
62
  end
63
63
 
@@ -12,26 +12,26 @@ describe Arachni::Component::Manager do
12
12
 
13
13
  describe '#lib' do
14
14
  it 'returns the component library' do
15
- @components.lib.should == @lib
15
+ expect(@components.lib).to eq(@lib)
16
16
  end
17
17
  end
18
18
 
19
19
  describe '#namespace' do
20
20
  it 'returns the namespace under which all components are defined' do
21
- @components.namespace.should == @namespace
21
+ expect(@components.namespace).to eq(@namespace)
22
22
  end
23
23
  end
24
24
 
25
25
  describe '#available' do
26
26
  it 'returns all available components' do
27
- @components.available.sort.should == available
27
+ expect(@components.available.sort).to eq(available)
28
28
  end
29
29
  end
30
30
 
31
31
  describe '#load_all' do
32
32
  it 'loads all components' do
33
33
  @components.load_all
34
- @components.loaded.sort.should == @components.available.sort
34
+ expect(@components.loaded.sort).to eq(@components.available.sort)
35
35
  end
36
36
  end
37
37
 
@@ -41,21 +41,21 @@ describe Arachni::Component::Manager do
41
41
  context String do
42
42
  it 'loads the component by name' do
43
43
  @components.load( 'wait' )
44
- @components.loaded.should == %w(wait)
44
+ expect(@components.loaded).to eq(%w(wait))
45
45
  end
46
46
  end
47
47
 
48
48
  context Symbol do
49
49
  it 'loads the component by name' do
50
50
  @components.load( :wait )
51
- @components.loaded.should == %w(wait)
51
+ expect(@components.loaded).to eq(%w(wait))
52
52
  end
53
53
  end
54
54
 
55
55
  context Array do
56
56
  it 'loads the components by name' do
57
57
  @components.load( %w(bad distributable) )
58
- @components.loaded.sort.should == %w(bad distributable).sort
58
+ expect(@components.loaded.sort).to eq(%w(bad distributable).sort)
59
59
  end
60
60
  end
61
61
 
@@ -63,21 +63,21 @@ describe Arachni::Component::Manager do
63
63
  context String do
64
64
  it 'loads components by name' do
65
65
  @components.load( 'wait', 'bad' )
66
- @components.loaded.sort.should == %w(bad wait).sort
66
+ expect(@components.loaded.sort).to eq(%w(bad wait).sort)
67
67
  end
68
68
  end
69
69
 
70
70
  context Symbol do
71
71
  it 'loads components by name' do
72
72
  @components.load :wait, :distributable
73
- @components.loaded.sort.should == %w(wait distributable).sort
73
+ expect(@components.loaded.sort).to eq(%w(wait distributable).sort)
74
74
  end
75
75
  end
76
76
 
77
77
  context Array do
78
78
  it 'loads components by name' do
79
79
  @components.load( :wait, %w(bad distributable) )
80
- @components.loaded.sort.should == %w(bad distributable wait).sort
80
+ expect(@components.loaded.sort).to eq(%w(bad distributable wait).sort)
81
81
  end
82
82
  end
83
83
  end
@@ -86,14 +86,14 @@ describe Arachni::Component::Manager do
86
86
  context 'alone' do
87
87
  it 'loads all components' do
88
88
  @components.load( '*' )
89
- @components.loaded.sort.should == @components.available.sort
89
+ expect(@components.loaded.sort).to eq(@components.available.sort)
90
90
  end
91
91
  end
92
92
 
93
93
  context 'with a category name' do
94
94
  it 'loads all of its components' do
95
95
  @components.load( 'plugins/*' )
96
- @components.loaded.sort.should == @components.available.sort
96
+ expect(@components.loaded.sort).to eq(@components.available.sort)
97
97
  end
98
98
  end
99
99
 
@@ -103,7 +103,7 @@ describe Arachni::Component::Manager do
103
103
  context 'alone' do
104
104
  it 'loads nothing' do
105
105
  @components.load( '-' )
106
- @components.loaded.sort.should be_empty
106
+ expect(@components.loaded.sort).to be_empty
107
107
  end
108
108
  end
109
109
  context 'with a name' do
@@ -111,7 +111,7 @@ describe Arachni::Component::Manager do
111
111
  @components.load( %w(* -wait) )
112
112
  loaded = @components.available
113
113
  loaded.delete( 'wait' )
114
- @components.loaded.sort.should == loaded.sort
114
+ expect(@components.loaded.sort).to eq(loaded.sort)
115
115
  end
116
116
  end
117
117
  context 'with a partial name and a wildcard' do
@@ -120,7 +120,7 @@ describe Arachni::Component::Manager do
120
120
  loaded = @components.available
121
121
  loaded.delete( 'wait' )
122
122
  loaded.delete( 'distributable' )
123
- @components.loaded.sort.should == loaded.sort
123
+ expect(@components.loaded.sort).to eq(loaded.sort)
124
124
  end
125
125
  end
126
126
  end
@@ -141,79 +141,79 @@ describe Arachni::Component::Manager do
141
141
  context 'when passed' do
142
142
  context 'nil' do
143
143
  it 'returns an empty array' do
144
- @components.empty?.should be_true
145
- @components.load_by_tags( nil ).should == []
144
+ expect(@components.empty?).to be_truthy
145
+ expect(@components.load_by_tags( nil )).to eq([])
146
146
  end
147
147
  end
148
148
 
149
149
  context '[]' do
150
150
  it 'returns an empty array' do
151
- @components.empty?.should be_true
152
- @components.load_by_tags( [] ).should == []
151
+ expect(@components.empty?).to be_truthy
152
+ expect(@components.load_by_tags( [] )).to eq([])
153
153
  end
154
154
  end
155
155
 
156
156
  context String do
157
157
  it 'loads components whose tags include the given tag (as either a String or a Symbol)' do
158
- @components.empty?.should be_true
158
+ expect(@components.empty?).to be_truthy
159
159
 
160
- @components.load_by_tags( 'wait_string' ).should == %w(wait)
160
+ expect(@components.load_by_tags( 'wait_string' )).to eq(%w(wait))
161
161
  @components.delete( 'wait' )
162
- @components.empty?.should be_true
162
+ expect(@components.empty?).to be_truthy
163
163
 
164
- @components.load_by_tags( 'wait_sym' ).should == %w(wait)
164
+ expect(@components.load_by_tags( 'wait_sym' )).to eq(%w(wait))
165
165
  @components.delete( 'wait' )
166
- @components.empty?.should be_true
166
+ expect(@components.empty?).to be_truthy
167
167
 
168
- @components.load_by_tags( 'distributable_string' ).should == %w(distributable)
168
+ expect(@components.load_by_tags( 'distributable_string' )).to eq(%w(distributable))
169
169
  @components.delete( 'distributable' )
170
- @components.empty?.should be_true
170
+ expect(@components.empty?).to be_truthy
171
171
 
172
- @components.load_by_tags( 'distributable_sym' ).should == %w(distributable)
172
+ expect(@components.load_by_tags( 'distributable_sym' )).to eq(%w(distributable))
173
173
  @components.delete( 'distributable' )
174
- @components.empty?.should be_true
174
+ expect(@components.empty?).to be_truthy
175
175
 
176
176
  end
177
177
  end
178
178
 
179
179
  context Symbol do
180
180
  it 'loads components whose tags include the given tag (as either a String or a Symbol)' do
181
- @components.empty?.should be_true
181
+ expect(@components.empty?).to be_truthy
182
182
 
183
- @components.load_by_tags( :wait_string ).should == %w(wait)
183
+ expect(@components.load_by_tags( :wait_string )).to eq(%w(wait))
184
184
  @components.delete( 'wait' )
185
- @components.empty?.should be_true
185
+ expect(@components.empty?).to be_truthy
186
186
 
187
- @components.load_by_tags( :wait_sym ).should == %w(wait)
187
+ expect(@components.load_by_tags( :wait_sym )).to eq(%w(wait))
188
188
  @components.delete( 'wait' )
189
- @components.empty?.should be_true
189
+ expect(@components.empty?).to be_truthy
190
190
 
191
- @components.load_by_tags( :distributable_string ).should == %w(distributable)
191
+ expect(@components.load_by_tags( :distributable_string )).to eq(%w(distributable))
192
192
  @components.delete( 'distributable' )
193
- @components.empty?.should be_true
193
+ expect(@components.empty?).to be_truthy
194
194
 
195
- @components.load_by_tags( :distributable_sym ).should == %w(distributable)
195
+ expect(@components.load_by_tags( :distributable_sym )).to eq(%w(distributable))
196
196
  @components.delete( 'distributable' )
197
- @components.empty?.should be_true
197
+ expect(@components.empty?).to be_truthy
198
198
  end
199
199
  end
200
200
 
201
201
  context Array do
202
202
  it 'loads components which include any of the given tags (as either Strings or a Symbols)' do
203
- @components.empty?.should be_true
203
+ expect(@components.empty?).to be_truthy
204
204
 
205
205
  expected = %w(wait distributable).sort
206
- @components.load_by_tags( [ :wait_string, 'distributable_string' ] ).sort.should == expected
206
+ expect(@components.load_by_tags( [ :wait_string, 'distributable_string' ] ).sort).to eq(expected)
207
207
  @components.clear
208
- @components.empty?.should be_true
208
+ expect(@components.empty?).to be_truthy
209
209
 
210
- @components.load_by_tags( [ 'wait_string', :distributable_string ] ).sort.should == expected
210
+ expect(@components.load_by_tags( [ 'wait_string', :distributable_string ] ).sort).to eq(expected)
211
211
  @components.clear
212
- @components.empty?.should be_true
212
+ expect(@components.empty?).to be_truthy
213
213
 
214
- @components.load_by_tags( [ 'wait_sym', :distributable_sym ] ).sort.should == expected
214
+ expect(@components.load_by_tags( [ 'wait_sym', :distributable_sym ] ).sort).to eq(expected)
215
215
  @components.clear
216
- @components.empty?.should be_true
216
+ expect(@components.empty?).to be_truthy
217
217
  end
218
218
 
219
219
  end
@@ -225,33 +225,34 @@ describe Arachni::Component::Manager do
225
225
 
226
226
  context String do
227
227
  it 'returns an array including the component\'s name' do
228
- @components.parse( 'wait' ).should == %w(wait)
228
+ expect(@components.parse( 'wait' )).to eq(%w(wait))
229
229
  end
230
230
  end
231
231
 
232
232
  context Symbol do
233
233
  it 'returns an array including the component\'s name' do
234
- @components.parse( :wait ).should == %w(wait)
234
+ expect(@components.parse( :wait )).to eq(%w(wait))
235
235
  end
236
236
  end
237
237
 
238
238
  context Array do
239
239
  it 'loads the component by name' do
240
- @components.parse( %w(bad distributable) ).sort.should ==
240
+ expect(@components.parse( %w(bad distributable) ).sort).to eq(
241
241
  %w(bad distributable).sort
242
+ )
242
243
  end
243
244
  end
244
245
 
245
246
  context 'wildcard (*)' do
246
247
  context 'alone' do
247
248
  it 'returns all components' do
248
- @components.parse( '*' ).sort.should == @components.available.sort
249
+ expect(@components.parse( '*' ).sort).to eq(@components.available.sort)
249
250
  end
250
251
  end
251
252
 
252
253
  context 'with a category name' do
253
254
  it 'returns all of its components' do
254
- @components.parse( 'plugins/*' ).sort.should == @components.available.sort
255
+ expect(@components.parse( 'plugins/*' ).sort).to eq(@components.available.sort)
255
256
  end
256
257
  end
257
258
 
@@ -260,7 +261,7 @@ describe Arachni::Component::Manager do
260
261
  context 'exclusion filter (-)' do
261
262
  context 'alone' do
262
263
  it 'returns nothing' do
263
- @components.parse( '-' ).sort.should be_empty
264
+ expect(@components.parse( '-' ).sort).to be_empty
264
265
  end
265
266
  end
266
267
  context 'with a name' do
@@ -268,7 +269,7 @@ describe Arachni::Component::Manager do
268
269
  @components.parse( %w(* -wait) )
269
270
  loaded = @components.available
270
271
  loaded.delete( 'wait' )
271
- loaded.sort.should == loaded.sort
272
+ expect(loaded.sort).to eq(loaded.sort)
272
273
  end
273
274
  end
274
275
  context 'with a partial name and a wildcard' do
@@ -277,7 +278,7 @@ describe Arachni::Component::Manager do
277
278
  loaded = @components.available
278
279
  loaded.delete( 'wait' )
279
280
  loaded.delete( 'distributable' )
280
- parsed.sort.should == loaded.sort
281
+ expect(parsed.sort).to eq(loaded.sort)
281
282
  end
282
283
  end
283
284
  end
@@ -289,19 +290,19 @@ describe Arachni::Component::Manager do
289
290
  c = 'with_options'
290
291
 
291
292
  @components.load( c )
292
- @components.prepare_options( c, @components[c],
293
+ expect(@components.prepare_options( c, @components[c],
293
294
  { 'req_opt' => 'my value' }
294
- ).should == {
295
+ )).to eq({
295
296
  req_opt: 'my value',
296
297
  default_opt: 'value'
297
- }
298
+ })
298
299
 
299
300
  opts = {
300
301
  'req_opt' => 'req_opt value',
301
302
  'opt_opt' => 'opt_opt value',
302
303
  'default_opt' => 'value2'
303
304
  }
304
- @components.prepare_options( c, @components[c], opts ).should == opts.my_symbolize_keys
305
+ expect(@components.prepare_options( c, @components[c], opts )).to eq(opts.my_symbolize_keys)
305
306
  end
306
307
 
307
308
  context 'with missing options' do
@@ -347,16 +348,16 @@ describe Arachni::Component::Manager do
347
348
  context 'when passed a' do
348
349
  context String do
349
350
  it 'should load and return the component' do
350
- @components.loaded.should be_empty
351
- @components['wait'].name.should == 'Arachni::Plugins::Wait'
352
- @components.loaded.should == %w(wait)
351
+ expect(@components.loaded).to be_empty
352
+ expect(@components['wait'].name).to eq('Arachni::Plugins::Wait')
353
+ expect(@components.loaded).to eq(%w(wait))
353
354
  end
354
355
  end
355
356
  context Symbol do
356
357
  it 'should load and return the component' do
357
- @components.loaded.should be_empty
358
- @components[:wait].name.should == 'Arachni::Plugins::Wait'
359
- @components.loaded.should == %w(wait)
358
+ expect(@components.loaded).to be_empty
359
+ expect(@components[:wait].name).to eq('Arachni::Plugins::Wait')
360
+ expect(@components.loaded).to eq(%w(wait))
360
361
  end
361
362
  end
362
363
  end
@@ -367,36 +368,36 @@ describe Arachni::Component::Manager do
367
368
  context String do
368
369
  context 'when the component has been loaded' do
369
370
  it 'returns true' do
370
- @components.loaded.should be_empty
371
- @components['wait'].name.should == 'Arachni::Plugins::Wait'
372
- @components.loaded.should == %w(wait)
373
- @components.loaded?( 'wait' ).should be_true
374
- @components.include?( 'wait' ).should be_true
371
+ expect(@components.loaded).to be_empty
372
+ expect(@components['wait'].name).to eq('Arachni::Plugins::Wait')
373
+ expect(@components.loaded).to eq(%w(wait))
374
+ expect(@components.loaded?( 'wait' )).to be_truthy
375
+ expect(@components.include?( 'wait' )).to be_truthy
375
376
  end
376
377
  end
377
378
  context 'when the component has not been loaded' do
378
379
  it 'returns false' do
379
- @components.loaded.should be_empty
380
- @components.loaded?( 'wait' ).should be_false
381
- @components.include?( 'wait' ).should be_false
380
+ expect(@components.loaded).to be_empty
381
+ expect(@components.loaded?( 'wait' )).to be_falsey
382
+ expect(@components.include?( 'wait' )).to be_falsey
382
383
  end
383
384
  end
384
385
  end
385
386
  context Symbol do
386
387
  context 'when the component has been loaded' do
387
388
  it 'returns true' do
388
- @components.loaded.should be_empty
389
- @components[:wait].name.should == 'Arachni::Plugins::Wait'
390
- @components.loaded.should == %w(wait)
391
- @components.loaded?( :wait ).should be_true
392
- @components.include?( :wait ).should be_true
389
+ expect(@components.loaded).to be_empty
390
+ expect(@components[:wait].name).to eq('Arachni::Plugins::Wait')
391
+ expect(@components.loaded).to eq(%w(wait))
392
+ expect(@components.loaded?( :wait )).to be_truthy
393
+ expect(@components.include?( :wait )).to be_truthy
393
394
  end
394
395
  end
395
396
  context 'when the component has not been loaded' do
396
397
  it 'returns false' do
397
- @components.loaded.should be_empty
398
- @components.loaded?( :wait ).should be_false
399
- @components.include?( :wait ).should be_false
398
+ expect(@components.loaded).to be_empty
399
+ expect(@components.loaded?( :wait )).to be_falsey
400
+ expect(@components.include?( :wait )).to be_falsey
400
401
  end
401
402
  end
402
403
  end
@@ -405,86 +406,86 @@ describe Arachni::Component::Manager do
405
406
 
406
407
  describe '#delete' do
407
408
  it 'removes a component' do
408
- @components.loaded.should be_empty
409
+ expect(@components.loaded).to be_empty
409
410
 
410
411
  @components.load( 'wait' )
411
412
  klass = @components['wait']
412
413
 
413
414
  sym = klass.name.split( ':' ).last.to_sym
414
- @components.namespace.constants.include?( sym ).should be_true
415
- @components.loaded.should be_any
415
+ expect(@components.namespace.constants.include?( sym )).to be_truthy
416
+ expect(@components.loaded).to be_any
416
417
 
417
418
  @components.delete( 'wait' )
418
- @components.loaded.should be_empty
419
+ expect(@components.loaded).to be_empty
419
420
 
420
421
  sym = klass.name.split( ':' ).last.to_sym
421
- @components.namespace.constants.include?( sym ).should be_false
422
+ expect(@components.namespace.constants.include?( sym )).to be_falsey
422
423
  end
423
424
  it 'unloads a component' do
424
- @components.loaded.should be_empty
425
+ expect(@components.loaded).to be_empty
425
426
 
426
427
  @components.load( 'wait' )
427
428
  klass = @components['wait']
428
429
 
429
430
  sym = klass.name.split( ':' ).last.to_sym
430
- @components.namespace.constants.include?( sym ).should be_true
431
- @components.loaded.should be_any
431
+ expect(@components.namespace.constants.include?( sym )).to be_truthy
432
+ expect(@components.loaded).to be_any
432
433
 
433
434
  @components.delete( 'wait' )
434
- @components.loaded.should be_empty
435
+ expect(@components.loaded).to be_empty
435
436
 
436
437
  sym = klass.name.split( ':' ).last.to_sym
437
- @components.namespace.constants.include?( sym ).should be_false
438
+ expect(@components.namespace.constants.include?( sym )).to be_falsey
438
439
  end
439
440
  end
440
441
 
441
442
  describe '#loaded' do
442
443
  it 'returns all loaded components' do
443
444
  @components.load( '*' )
444
- @components.loaded.sort.should == available
445
+ expect(@components.loaded.sort).to eq(available)
445
446
  end
446
447
  end
447
448
 
448
449
  describe '#name_to_path' do
449
450
  it 'returns a component\'s path from its name' do
450
451
  path = @components.name_to_path( 'wait' )
451
- File.exists?( path ).should be_true
452
- File.basename( path ).should == 'wait.rb'
452
+ expect(File.exists?( path )).to be_truthy
453
+ expect(File.basename( path )).to eq('wait.rb')
453
454
  end
454
455
  end
455
456
 
456
457
  describe '#path_to_name' do
457
458
  it 'returns a component\'s name from its path' do
458
459
  path = @components.name_to_path( 'wait' )
459
- @components.path_to_name( path ).should == 'wait'
460
+ expect(@components.path_to_name( path )).to eq('wait')
460
461
  end
461
462
  end
462
463
 
463
464
  describe '#paths' do
464
465
  it 'returns all component paths' do
465
466
  paths = @components.paths
466
- paths.each { |p| File.exists?( p ).should be_true }
467
- paths.size.should == @components.available.size
467
+ paths.each { |p| expect(File.exists?( p )).to be_truthy }
468
+ expect(paths.size).to eq(@components.available.size)
468
469
  end
469
470
  end
470
471
 
471
472
  describe '#clear' do
472
473
  it 'unloads all components' do
473
- @components.loaded.should be_empty
474
+ expect(@components.loaded).to be_empty
474
475
  @components.load( '*' )
475
- @components.loaded.sort.should == @components.available.sort
476
+ expect(@components.loaded.sort).to eq(@components.available.sort)
476
477
 
477
478
  symbols = @components.values.map do |klass|
478
479
  sym = klass.name.split( ':' ).last.to_sym
479
- @components.namespace.constants.include?( sym ).should be_true
480
+ expect(@components.namespace.constants.include?( sym )).to be_truthy
480
481
  sym
481
482
  end
482
483
 
483
484
  @components.clear
484
485
  symbols.each do |sym|
485
- @components.namespace.constants.include?( sym ).should be_false
486
+ expect(@components.namespace.constants.include?( sym )).to be_falsey
486
487
  end
487
- @components.loaded.should be_empty
488
+ expect(@components.loaded).to be_empty
488
489
  end
489
490
  end
490
491
  end