Skip to content

Commit

Permalink
Now when you create a new CVE or a new check a spec mock is created as
Browse files Browse the repository at this point in the history
well
  • Loading branch information
thesp0nge committed Jan 6, 2014
1 parent 60d8580 commit 0588cc8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ task :new_cve, :name do |t,args|
end
puts "#{rb_filename} created"

open(spec_filename, "w") do |file|
file.puts "require 'spec_helper'"

file.puts "describe \"The #{name} vulnerability do\""
file.puts "\tbefore(:all) do"
file.puts "\t\t@check = Codesake::Dawn::Kb::#{class_name}.new"
file.puts "\t\t# @check.debug = true"
file.puts "\tend"
file.puts "\tit \"you may want to test something here...\""
file.puts "end"
end
puts "#{spec_filename} created"

puts "*** PLEASE IMPLEMENT TEST FOR #{name} IN spec/lib/dawn/codesake_knowledgebase_spec.rb in order to reflect changes"
puts "*** PLEASE ADD THIS CODE IN lib/codesake/dawn/knowledge_base.rb in order to reflect changes"
puts "require \"codesake/dawn/kb/#{class_name.downcase}\""
Expand Down Expand Up @@ -109,6 +122,20 @@ task :new_check, :name do |t,args|
end
puts "#{rb_filename} created"

open(spec_filename, "w") do |file|
file.puts "require 'spec_helper'"

file.puts "describe \"The #{name} vulnerability do\""
file.puts "\tbefore(:all) do"
file.puts "\t\t@check = Codesake::Dawn::Kb::#{class_name}.new"
file.puts "\t\t# @check.debug = true"
file.puts "\tend"
file.puts "\tit \"you may want to test something here...\""
file.puts "end"
end
puts "#{spec_filename} created"


puts "*** PLEASE IMPLEMENT TEST FOR #{name} IN spec/lib/dawn/codesake_knowledgebase_spec.rb in order to reflect changes"
puts "*** PLEASE ADD THIS CODE IN lib/codesake/dawn/knowledge_base.rb in order to reflect changes"
puts "require \"codesake/dawn/kb/#{class_name.downcase}\""
Expand Down

0 comments on commit 0588cc8

Please sign in to comment.