Guest User

Untitled

a guest
Feb 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. require 'autotest/fsevent'
  2. #require 'redgreen/autotest' if ENV['RSPEC'] != 'true'
  3. #require 'autotest/growl'
  4. #require 'redgreen'
  5.  
  6. #$: << File.join(File.dirname(__FILE__), 'spec')
  7.  
  8.  
  9. # SPEAKING = false
  10. # DOOM_EDITION = false
  11. # BUUF = false
  12. # PENDING = false
  13. # STICKY = false
  14. # SUCCESS_SOUND = ''
  15. # FAILURE_SOUND = ''
  16.  
  17. #run all tests for ANY file
  18.  
  19. Autotest.add_hook :initialize do |at|
  20. unless ARGV.empty?
  21. spec_dir = ENV['SPEC_EXT'] ? 'spec_ext' : 'spec'
  22.  
  23.  
  24. at.clear_mappings
  25. at.add_mapping(/^#{spec_dir}\/(.*)_spec.rb$/) { |filename, m|
  26. if ARGV.any? {|x| m[1].include?(x) }
  27. filename
  28. else
  29. puts "skipping spec: #{filename}"
  30. end
  31. }
  32. at.add_mapping(%r{^(app|lib)/.*/(.*)\.rb$}) { |_, m|
  33. if ARGV.include?(m[2])
  34. at.files_matching %r{^#{spec_dir}/.*/#{m[2]}_spec.rb$}
  35. end
  36. }
  37. end
  38. end
Add Comment
Please, Sign In to add comment