Rakefile in secure_headers-0.1.1 vs Rakefile in secure_headers-0.2.0
- old
+ new
@@ -5,12 +5,53 @@
require 'net/https'
desc "Run RSpec"
RSpec::Core::RakeTask.new do |t|
t.verbose = false
+ t.rspec_opts = "--format progress"
end
+task :default => :all_spec
+
+desc "Run all specs, and test fixture apps"
+task :all_spec => :spec do
+ pwd = Dir.pwd
+ Dir.chdir 'fixtures/rails_3_2_12'
+ puts Dir.pwd
+ str = `bundle install >> /dev/null; bundle exec rspec spec`
+ puts str
+ unless $? == 0
+ Dir.chdir pwd
+ fail "Header tests with app not using initializer failed exit code: #{$?}"
+ end
+
+ Dir.chdir pwd
+ Dir.chdir 'fixtures/rails_3_2_12_no_init'
+ puts Dir.pwd
+ puts `bundle install >> /dev/null; bundle exec rspec spec`
+
+ unless $? == 0
+ fail "Header tests with app not using initializer failed"
+ Dir.chdir pwd
+ end
+end
+
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'SecureHeaders'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
UPDATE_URI = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1'
CA_FILE = File.expand_path(File.join('..', 'config', 'curl-ca-bundle.crt'), __FILE__)
task :fetch_ca_bundle do
begin
FileUtils.cp CA_FILE, CA_FILE + ".bak"
@@ -122,6 +163,5 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
EOM
end
-task :default => :spec
\ No newline at end of file