[DRE-commits] [ruby-bluefeather] 01/02: Make package run tests found on original_tests dir

Lucas Moura lucasmoura-guest at moszumanska.debian.org
Wed Mar 2 18:37:49 UTC 2016


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

lucasmoura-guest pushed a commit to branch master
in repository ruby-bluefeather.

commit 60fd4a982562c13088a01ffe93dd40377f88906f
Author: Lucas Albuquerque Medeiros de Moura <lucas.moura128 at gmail.com>
Date:   Wed Mar 2 15:31:16 2016 -0300

    Make package run tests found on original_tests dir
    
    The ruby-test.rake file was previously modified with
    dh-make-ruby -w, however, with that modification, the tests
    on original_tests dir were not being executed. This file was then
    reseted to its older version, that was already running these tests.
---
 debian/ruby-tests.rake | 42 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index 04e7f07..8c71700 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -1,5 +1,41 @@
-require 'gem2deb/rake/spectask'
+require 'gem2deb/rake/testtask'
+require 'rspec/core/rake_task'
+require 'fileutils'
+# task 'default' => [:spec, 'original-test']
+task 'default' => :spec
 
-Gem2Deb::Rake::RSpecTask.new do |spec|
-  spec.pattern = './spec/*.rb'
+Rake::TestTask.new('original-test') do |tasklib|
+  tasklib.test_files = FileList['original-tests/*.tests.rb']
+end
+
+
+task_cls = RSpec::Core::RakeTask
+rspec_opts_setting_proc = proc do |task|
+  task.rspec_opts = ['-fs']
+end
+# Proc for initializing each spec-tasks by common parameters
+setting = proc do |st|
+  st.ruby_opts = %w(-Ku)
+end
+desc "Verify all spec files."
+task_cls.new do |st|
+  setting.call(st)
+  st.pattern = 'spec/*.rb'
+end
+
+desc "Verify all spec files with specdocs."
+task_cls.new(:specd) do |st|
+  setting.call(st)
+  rspec_opts_setting_proc.call(st)
+  st.pattern = 'spec/*.rb'
+end
+
+namespace :spec do
+  Dir.glob('spec/*.rb') do |path|
+    desc "Verify '#{path}'"
+    task_cls.new(File.basename(path, '.rb')) do |st|
+      setting.call(st)
+      st.pattern = path
+    end
+  end
 end

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



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