improved test cases
This commit is contained in:
@@ -5,19 +5,26 @@ require 'extensions/social_engineering/models/interceptor'
|
||||
require 'fileutils'
|
||||
|
||||
RSpec.describe 'BeEF Extension Social Engineering' do
|
||||
|
||||
it 'persistence web cloner' do
|
||||
expect {
|
||||
BeEF::Core::Models::WebCloner.create(uri: "example.com", mount: "/")
|
||||
}.to_not raise_error
|
||||
it 'checks if wget exists' do
|
||||
expect(`which wget`).to include('/wget')
|
||||
end
|
||||
|
||||
xit 'clone web page' do
|
||||
expect {
|
||||
BeEF::Core::Server.instance.prepare
|
||||
BeEF::Extension::SocialEngineering::WebCloner.instance.clone_page("https://www.google.com", "/", nil, nil)
|
||||
}.to_not raise_error
|
||||
FileUtils.rm(Dir['./extensions/social_engineering/web_cloner/cloned_pages/www.google.com'])
|
||||
FileUtils.rm(Dir['./extensions/social_engineering/web_cloner/cloned_pages/www.google.com_mod'])
|
||||
context 'when wget exists' do
|
||||
before(:each) do
|
||||
allow_any_instance_of(BeEF::Extension::SocialEngineering::WebCloner).to receive(:system).and_return(false) # Stub to simulate failure
|
||||
end
|
||||
|
||||
xit 'clone web page', if: !`which wget`.empty? do
|
||||
expect {
|
||||
BeEF::Core::Server.instance.prepare
|
||||
BeEF::Extension::SocialEngineering::WebCloner.instance.clone_page("https://www.google.com", "/", nil, nil)
|
||||
}.to_not raise_error
|
||||
end
|
||||
|
||||
it 'persistence web cloner', if: !`which wget`.empty? do
|
||||
expect {
|
||||
BeEF::Core::Models::WebCloner.create(uri: "example.com", mount: "/")
|
||||
}.to_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user