# File lib/bones/plugins/rcov.rb, line 50 def define_tasks return unless have? :rcov config = ::Bones.config if have? :test namespace :test do desc 'Run rcov on the unit tests' Rcov::RcovTask.new do |t| t.output_dir = config.rcov.dir t.rcov_opts = config.rcov.opts t.ruby_opts = config.ruby_opts.dup.concat(config.test.opts) t.test_files = if test(ff, config.test.file) then [config.test.file] else config.test.files.to_a end t.libs = config.libs unless config.libs.empty? end task :clobber_rcov do rm_r config.rcov.dir rescue nil end end task :clobber => 'test:clobber_rcov' end end
# File lib/bones/plugins/rcov.rb, line 6 def initialize_rcov require 'rcov' require 'rcov/rcovtask' have?(:rcov) { true } ::Bones.config { desc 'Configuration settings for the Rcov code coverage tool.' rcov { path 'rcov', :desc => Path to the rcov executable. dir 'coverage', :desc => Code coverage metrics will be written to this directory. opts ]--sort coverage -T], :desc => An array of command line options that will be passed to the rcov command when running your tests. See the Rcov help documentation either online or from the command line by running 'rcov --help'. threshold 90.0, :desc => The threshold value (in percent) for coverage. If the actual coverage is not greater than or equal to this value, the verify task will raise an exception. threshold_exact false, :desc => Require the threshold to be met exactly. By default this option is set to false. } } rescue LoadError have?(:rcov) { false } end
Generated with the Darkfish Rdoc Generator 2.