test.thor 518 B

1234567891011121314151617181920212223242526272829
  1. require 'pry'
  2. class TestCLI < Thor
  3. def self.to_s
  4. 'Test'
  5. end
  6. default_command :all
  7. def initialize(*args)
  8. $LOAD_PATH.unshift 'test'
  9. super
  10. end
  11. desc 'all', 'Run all tests'
  12. def all
  13. Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
  14. end
  15. desc 'docs', 'Run "Docs" tests'
  16. def docs
  17. Dir['test/lib/docs/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
  18. end
  19. desc 'app', 'Run "App" tests'
  20. def app
  21. require 'app_test'
  22. end
  23. end