/spec/lib/rex/exploitation/js/detect_spec.rb

https://github.com/debbiemezyene/metasploit-framework · Ruby · 30 lines · 23 code · 7 blank · 0 comment · 0 complexity · 7836d9f112c798db5ddb9930575ba7aa MD5 · raw file

  1. require 'rex/exploitation/js'
  2. describe Rex::Exploitation::Js::Detect do
  3. context "Class methods" do
  4. context ".os" do
  5. it "should load the OS detection in Javascript" do
  6. js = Rex::Exploitation::Js::Detect.os.to_s
  7. js.should =~ /window\.os_detect/
  8. end
  9. end
  10. context ".ie_addons" do
  11. it "should load the IE Addons detection in Javascript" do
  12. js = Rex::Exploitation::Js::Detect.ie_addons.to_s
  13. js.should =~ /window\.ie_addons_detect/
  14. end
  15. end
  16. context ".misc_addons" do
  17. it "should load the misc Addons detection in Javascript" do
  18. js = Rex::Exploitation::Js::Detect.misc_addons.to_s
  19. js.should =~ /window\.misc_addons_detect/
  20. end
  21. end
  22. end
  23. end