PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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