Guest User

Untitled

a guest
Jul 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. if defined?(RSpec)
  2. namespace :rcov do
  3. RSpec::Core::RakeTask.new(:rspec_aggregate) do |task|
  4. task.pattern = 'spec/**/*_spec.rb'
  5. task.rspec_opts = "--format progress"
  6. task.rcov = true
  7. task.rcov_opts = "--rails --exclude osx\/objc,spec,gems\/ " +
  8. "--aggregate tmp/coverage.data"
  9. end
  10.  
  11. Cucumber::Rake::Task.new(:cucumber_aggregate) do |task|
  12. task.rcov = true
  13. task.rcov_opts = "--rails --exclude osx\/objc,gems\/,spec\/,features\/ " +
  14. "--aggregate tmp/coverage.data -o 'coverage'"
  15. end
  16.  
  17. task :clean_aggregate do
  18. rm "tmp/coverage.data" if File.exist?("tmp/coverage.data")
  19. end
  20.  
  21. desc "Run aggregate coverage from rspec and cucumber"
  22. task :rcov => ["rcov:clean_aggregate",
  23. "rcov:rspec_aggregate",
  24. "rcov:cucumber_aggregate"]
  25.  
  26. desc "Find potentially unused app code"
  27. Cucumber::Rake::Task.new(:unused) do |task|
  28. task.rcov = true
  29. task.rcov_opts = "--rails --exclude osx\/objc,spec,gems\/,features\/ " +
  30. "--only-uncovered"
  31. end
  32.  
  33. desc "Find unused cucumber step definitions"
  34. Cucumber::Rake::Task.new(:steps) do |task|
  35. task.rcov = true
  36. task.rcov_opts = "--rails --exclude osx\/objc,spec,gems\/,app\/,lib\/" +
  37. "--only-uncovered"
  38. end
  39. end
  40.  
  41. desc "Run cumulative coverage from rspec and cucumber"
  42. task :rcov => ["rcov:clean_aggregate", "rcov:rspec_aggregate", "rcov:cucumber_aggregate"]
  43. end
Add Comment
Please, Sign In to add comment