Prechádzať zdrojové kódy

Add thor tasks for running individual test suites

Thibaut 11 rokov pred
rodič
commit
85b6d84bc3
2 zmenil súbory, kde vykonal 17 pridanie a 1 odobranie
  1. 2 0
      README.md
  2. 15 1
      lib/tasks/test.thor

+ 2 - 0
README.md

@@ -115,6 +115,8 @@ for usage instructions.
 
 # Tests
 thor test:all       # Run all tests
+thor test:docs      # Run "Docs" tests
+thor test:app       # Run "App" tests
 
 # Assets
 thor assets:compile # Compile assets (not required in development mode)

+ 15 - 1
lib/tasks/test.thor

@@ -7,9 +7,23 @@ class TestCLI < Thor
 
   default_command :all
 
+  def initialize(*args)
+    $LOAD_PATH.unshift 'test'
+    super
+  end
+
   desc 'all', 'Run all tests'
   def all
-    $LOAD_PATH.unshift 'test'
     Dir['test/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
   end
+
+  desc 'docs', 'Run "Docs" tests'
+  def docs
+    Dir['test/lib/docs/**/*_test.rb'].map(&File.method(:expand_path)).each(&method(:require))
+  end
+
+  desc 'app', 'Run "App" tests'
+  def app
+    require 'app_test'
+  end
 end