[DRE-commits] [ruby-delayed-job] 04/04: Make tests run

Balasankar C balasankarc-guest at moszumanska.debian.org
Tue May 26 16:30:41 UTC 2015


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

balasankarc-guest pushed a commit to branch master
in repository ruby-delayed-job.

commit 3635af1ad7bd51652c636bac687838869bf7b221
Author: Balasankar C <balasankarc at autistici.org>
Date:   Tue May 26 21:44:17 2015 +0530

    Make tests run
---
 debian/dirs                |  1 +
 debian/patches/sample_jobs | 18 ++++++++++++++++++
 debian/patches/series      |  2 ++
 debian/patches/simplecov   | 30 ++++++++++++++++++++++++++++++
 debian/ruby-tests.rake     |  9 +++++----
 debian/rules               |  9 ++++++++-
 debian/tests/control.ex    | 13 -------------
 7 files changed, 64 insertions(+), 18 deletions(-)

diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..08d0f34
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+usr/share/ruby-delayed-job
diff --git a/debian/patches/sample_jobs b/debian/patches/sample_jobs
new file mode 100644
index 0000000..392b57a
--- /dev/null
+++ b/debian/patches/sample_jobs
@@ -0,0 +1,18 @@
+Description: Relative path for sample_jobs.rb
+ The file sample_jobs inside spec directory is needed for the program to run. 
+ Make it available via relative as well as static paths.
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/delayed/backend/shared_spec.rb
++++ b/lib/delayed/backend/shared_spec.rb
+@@ -1,5 +1,8 @@
+-require File.expand_path('../../../../spec/sample_jobs', __FILE__)
+-
++if File.exist?(File.expand_path('../../../../spec/sample_jobs.rb', __FILE__)) then
++    require File.expand_path('../../../../spec/sample_jobs', __FILE__)
++else
++    require '/usr/share/ruby-delayed-job/sample_jobs'
++end
+ require 'active_support/core_ext'
+ 
+ shared_examples_for 'a delayed_job backend' do
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..01519e9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+simplecov
+sample_jobs
diff --git a/debian/patches/simplecov b/debian/patches/simplecov
new file mode 100644
index 0000000..bd8b5c4
--- /dev/null
+++ b/debian/patches/simplecov
@@ -0,0 +1,30 @@
+Description: Disable simplecov
+ Disable simplecov while running tests.
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/spec/helper.rb
++++ b/spec/helper.rb
+@@ -1,14 +1,14 @@
+-require 'simplecov'
+-require 'coveralls'
++#require 'simplecov'
++#require 'coveralls'
+ 
+-SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
++#SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
+ 
+-SimpleCov.start do
+-  add_filter '/spec/'
+-  # Each version of ruby and version of rails test different things
+-  # This should probably just be removed.
+-  minimum_coverage(85.0)
+-end
++#SimpleCov.start do
++  #add_filter '/spec/'
++  ## Each version of ruby and version of rails test different things
++  ## This should probably just be removed.
++  #minimum_coverage(85.0)
++#end
+ 
+ require 'logger'
+ require 'rspec'
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index dcc1601..a1b5d4d 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -1,7 +1,8 @@
 require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new(:spec) do |spec|
-  spec.pattern = './spec/**/*_spec.rb'
+desc 'Run the specs'
+RSpec::Core::RakeTask.new do |r|
+  r.verbose = false
 end
 
-task :default => :spec
+task :test => :spec
+task :default => [:spec]
diff --git a/debian/rules b/debian/rules
index 5e904b3..94fde2a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,10 +6,17 @@
 #
 # Uncomment to ignore some test failures (but the tests will run anyway).
 # Valid values:
-#export DH_RUBY_IGNORE_TESTS=ruby2.1
+#export DH_RUBY_IGNORE_TESTS=ruby2.1 require-rubygems
 #
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_install:
+	chmod +x debian/ruby-delayed-job/usr/lib/ruby/vendor_ruby/generators/delayed_job/templates/script
+	cp spec/sample_jobs.rb debian/ruby-delayed-job/usr/share/ruby-delayed-job/
+	dh_install
+override_dh_installchangelogs:
+	dh_installchangelogs CHANGELOG.md
diff --git a/debian/tests/control.ex b/debian/tests/control.ex
deleted file mode 100644
index 429a392..0000000
--- a/debian/tests/control.ex
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED FILE
-#
-# As of autopkgtest 3.5, Ruby packages that use gem2deb are automatically
-# detected, and if debian/tests/control does not exist the contents below will
-# be assumed (with the exception of gem2deb being filtered out from
-# @builddeps@):
-
-Test-Command: gem2deb-test-runner --autopkgtest 2>&1
-Depends: @, @builddeps@, gem2deb-test-runner
-
-# if you would need to change something to the above, to that and rename this
-# file to `control`. Otherwise, you should probably delete this file
-# (recommended).

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



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