[DRE-commits] [nanoc] 02/06: use the Rake method to run the tests

Cédric Boutillier boutil at moszumanska.debian.org
Wed Mar 2 21:16:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository nanoc.

commit c8b1967accad32caab425147d06ea19039918139
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Mar 2 21:52:59 2016 +0100

    use the Rake method to run the tests
---
 debian/ruby-tests.rake | 18 ++++++++++++++++++
 debian/ruby-tests.rb   | 19 -------------------
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
new file mode 100644
index 0000000..aa1a269
--- /dev/null
+++ b/debian/ruby-tests.rake
@@ -0,0 +1,18 @@
+require "rake/testtask"
+
+#SUBDIRS = %w( * base cli data_sources extra filters helpers ).freeze
+SUBDIRS = %w(base cli data_sources filters helpers ).freeze
+
+
+namespace :test do
+  SUBDIRS.each do |dir|
+    Rake::TestTask.new(dir == '*' ? 'all' : dir) do |t|
+      t.test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
+      t.ruby_opts = ['-r./test/helper']
+    end
+  end
+end
+
+
+
+task default: SUBDIRS.map {|x| "test:#{x}".to_sym}
diff --git a/debian/ruby-tests.rb b/debian/ruby-tests.rb
deleted file mode 100644
index d0f688b..0000000
--- a/debian/ruby-tests.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-Encoding.default_external = "UTF-8" if defined? Encoding
-
-#require 'nanoc'
-require 'minitest/autorun'
-
-#needed for some tests
-require 'yard'
-
-#$VERBOSE = 1
-
-#$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/..'))
-
-# require our test helper so we don't have to in each individual test
-require './test/helper'
-
-test_files = Dir['./test/base/core_ext/*_spec.rb'] + Dir['./test/{base,cli,data_sources,filters,helpers,tasks}/**/test_*.rb']
-#test_files = Dir['test/filters/test_*.rb']
-#test_files = Dir['test/filters/test_bluecloth.rb']
-test_files.each { |f| require f }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/nanoc.git



More information about the Pkg-ruby-extras-commits mailing list