require 'ronin/generators/exploits/exploit' require 'ronin/exploits/exploit' require 'spec_helper' require 'generators/exploits/exploit_examples' require 'tmpdir' require 'fileutils' describe Generators::Exploits::Exploit do before(:all) do @path = File.join(Dir.tmpdir,'generated_exploit.rb') Generators::Exploits::Exploit.generate( { :helpers => ['buffer_overflow'], :controls => ['code_exec'] }, [@path] ) @exploit = Exploits::Exploit.load_from(@path) end it_should_behave_like "an Exploit" it "should define an Exploit" do @exploit.class.should == Exploits::Exploit end it "should define helpers to load" do @exploit.kind_of?(Exploits::Helpers::BufferOverflow).should == true end it "should define behaviors which it controls" do @exploit.behaviors.should == [:code_exec] end after(:all) do FileUtils.rm(@path) end end