2013-10-22 06:11:11 +00:00
|
|
|
require 'rex/exploitation/js'
|
|
|
|
|
|
|
|
describe Rex::Exploitation::Js::Detect do
|
|
|
|
|
|
|
|
context "Class methods" do
|
|
|
|
|
|
|
|
context ".os" do
|
2013-11-07 06:54:52 +00:00
|
|
|
it "should load the OS detection in Javascript" do
|
2013-10-22 06:11:11 +00:00
|
|
|
js = Rex::Exploitation::Js::Detect.os.to_s
|
|
|
|
js.should =~ /window\.os_detect/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-11-05 07:14:12 +00:00
|
|
|
context ".ie_addons" do
|
2013-11-07 06:54:52 +00:00
|
|
|
it "should load the IE Addons detection in Javascript" do
|
2013-11-05 07:14:12 +00:00
|
|
|
js = Rex::Exploitation::Js::Detect.ie_addons.to_s
|
2013-11-07 06:54:52 +00:00
|
|
|
js.should =~ /window\.ie_addons_detect/
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context ".misc_addons" do
|
|
|
|
it "should load the misc Addons detection in Javascript" do
|
|
|
|
js = Rex::Exploitation::Js::Detect.misc_addons.to_s
|
|
|
|
js.should =~ /window\.misc_addons_detect/
|
2013-10-22 06:11:11 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|