Sha256: e03e58c5004e675f1ff353872fea7f5c0e3294554bf8b706d8ae0bf1a33d4ed7
Contents?: true
Size: 1.21 KB
Versions: 11
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' class Mockup include Dawn::Kb::RubyVersionCheck def initialize message = "This is a mock" super( :kind=>Dawn::KnowledgeBase::RUBY_VERSION_CHECK, :applies=>['sinatra', 'padrino', 'rails'], :message=> message ) # self.debug = true self.safe_rubies = [{:version=>"1.9.3", :patchlevel=>"p392"}, {:version=>"2.0.0", :patchlevel=>"p0"}] end end describe "The security check for Ruby interpreter version" do let (:check) {Mockup.new} it "fires if ruby version is vulnerable" do check.detected_ruby = {:version=>"1.9.2", :patchlevel=>"p10000"} check.vuln?.should == true end it "doesn't fire if ruby version is not vulnerable and patchlevel is not vulnerable" do check.detected_ruby = {:version=>"1.9.4", :patchlevel=>"p10000"} check.vuln?.should == false end it "doesn't fire if ruby version is vulnerable and patchlevel is not vulnerable" do check.detected_ruby = {:version=>"1.9.3", :patchlevel=>"p10000"} check.vuln?.should == false end it "fires if ruby version is vulnerable and patchlevel is vulnerable" do check.detected_ruby = {:version=>"1.9.3", :patchlevel=>"p391"} check.vuln?.should == true end end
Version data entries
11 entries across 11 versions & 1 rubygems