[DRE-commits] [ruby-octokit] 02/06: Enable unit tests

Miguel Landaeta nomadium at moszumanska.debian.org
Wed Mar 5 01:00:05 UTC 2014


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

nomadium pushed a commit to branch master
in repository ruby-octokit.

commit 46df7c1cda84e27c5872c32e72e351f0f8601972
Author: Miguel Landaeta <nomadium at debian.org>
Date:   Tue Mar 4 21:44:00 2014 -0300

    Enable unit tests
---
 debian/control                                |  7 +--
 debian/patches/01_disable_simplecov-html.diff | 16 ++++++
 debian/patches/02_disable_webmock.diff        | 20 ++++++++
 debian/patches/03_disable_vcr.diff            | 71 +++++++++++++++++++++++++++
 debian/patches/series                         |  3 ++
 debian/ruby-tests.rb                          | 15 +-----
 debian/rules                                  |  4 ++
 7 files changed, 120 insertions(+), 16 deletions(-)

diff --git a/debian/control b/debian/control
index 416e941..acfe430 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders:  <>
-Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.1~)
+Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.1~),
+ ruby-coveralls, ruby-sawyer (>= 0.5.2)
 Standards-Version: 3.9.4
 #Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-octokit.git
 #Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-octokit.git;a=summary
@@ -13,7 +14,7 @@ XS-Ruby-Versions: all
 Package: ruby-octokit
 Architecture: all
 XB-Ruby-Versions: ${ruby:Versions}
-Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter
-# bundler (~> 1.0, development), sawyer (~> 0.5.2)
+Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
+ ruby-sawyer (>= 0.5.2~)
 Description: Ruby toolkit for working with the GitHub API
  Simple wrapper for the GitHub API
diff --git a/debian/patches/01_disable_simplecov-html.diff b/debian/patches/01_disable_simplecov-html.diff
new file mode 100644
index 0000000..7702f19
--- /dev/null
+++ b/debian/patches/01_disable_simplecov-html.diff
@@ -0,0 +1,16 @@
+Description: Disable simplecov-html
+Author: Miguel Landaeta <miguel at debian.org>
+Forwarded: no
+Last-Update: 2014-03-04
+
+--- ruby-octokit-2.7.0.orig/spec/helper.rb
++++ ruby-octokit-2.7.0/spec/helper.rb
+@@ -2,7 +2,7 @@ require 'simplecov'
+ require 'coveralls'
+ 
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
+-  SimpleCov::Formatter::HTMLFormatter,
++  SimpleCov::Formatter::SimpleFormatter,
+   Coveralls::SimpleCov::Formatter
+ ]
+ SimpleCov.start
diff --git a/debian/patches/02_disable_webmock.diff b/debian/patches/02_disable_webmock.diff
new file mode 100644
index 0000000..3bd10bc
--- /dev/null
+++ b/debian/patches/02_disable_webmock.diff
@@ -0,0 +1,20 @@
+Description: Disable webmock
+Author: Miguel Landaeta <miguel at debian.org>
+Forwarded: no
+Last-Update: 2014-03-04
+
+--- ruby-octokit-2.7.0.orig/spec/helper.rb
++++ ruby-octokit-2.7.0/spec/helper.rb
+@@ -10,9 +10,10 @@ SimpleCov.start
+ require 'json'
+ require 'octokit'
+ require 'rspec'
+-require 'webmock/rspec'
++# webmock tests are excluded because is not available in Debian yet: #695194.
++#require 'webmock/rspec'
+ 
+-WebMock.disable_net_connect!(:allow => 'coveralls.io')
++#WebMock.disable_net_connect!(:allow => 'coveralls.io')
+ 
+ RSpec.configure do |config|
+   config.treat_symbols_as_metadata_keys_with_true_values = true
diff --git a/debian/patches/03_disable_vcr.diff b/debian/patches/03_disable_vcr.diff
new file mode 100644
index 0000000..be31fc7
--- /dev/null
+++ b/debian/patches/03_disable_vcr.diff
@@ -0,0 +1,71 @@
+Description: Disable vcr
+Author: Miguel Landaeta <miguel at debian.org>
+Forwarded: no
+Last-Update: 2014-03-04
+
+--- ruby-octokit-2.7.0.orig/spec/helper.rb
++++ ruby-octokit-2.7.0/spec/helper.rb
+@@ -19,34 +19,35 @@ RSpec.configure do |config|
+   config.treat_symbols_as_metadata_keys_with_true_values = true
+ end
+ 
+-require 'vcr'
+-VCR.configure do |c|
+-  c.configure_rspec_metadata!
+-  c.filter_sensitive_data("<GITHUB_LOGIN>") do
+-    test_github_login
+-  end
+-  c.filter_sensitive_data("<GITHUB_PASSWORD>") do
+-    test_github_password
+-  end
+-  c.filter_sensitive_data("<<ACCESS_TOKEN>>") do
+-    test_github_token
+-  end
+-  c.filter_sensitive_data("<GITHUB_CLIENT_ID>") do
+-    test_github_client_id
+-  end
+-  c.filter_sensitive_data("<GITHUB_CLIENT_SECRET>") do
+-    test_github_client_id
+-  end
+-  c.default_cassette_options = {
+-    :serialize_with             => :json,
+-    # TODO: Track down UTF-8 issue and remove
+-    :preserve_exact_body_bytes  => true,
+-    :decode_compressed_response => true,
+-    :record                     => ENV['TRAVIS'] ? :none : :once
+-  }
+-  c.cassette_library_dir = 'spec/cassettes'
+-  c.hook_into :webmock
+-end
++# vcr tests are excluded because is not available in Debian yet: #695195.
++#require 'vcr'
++#VCR.configure do |c|
++#  c.configure_rspec_metadata!
++#  c.filter_sensitive_data("<GITHUB_LOGIN>") do
++#    test_github_login
++#  end
++#  c.filter_sensitive_data("<GITHUB_PASSWORD>") do
++#    test_github_password
++#  end
++#  c.filter_sensitive_data("<<ACCESS_TOKEN>>") do
++#    test_github_token
++#  end
++#  c.filter_sensitive_data("<GITHUB_CLIENT_ID>") do
++#    test_github_client_id
++#  end
++#  c.filter_sensitive_data("<GITHUB_CLIENT_SECRET>") do
++#    test_github_client_id
++#  end
++#  c.default_cassette_options = {
++#    :serialize_with             => :json,
++#    # TODO: Track down UTF-8 issue and remove
++#    :preserve_exact_body_bytes  => true,
++#    :decode_compressed_response => true,
++#    :record                     => ENV['TRAVIS'] ? :none : :once
++#  }
++#  c.cassette_library_dir = 'spec/cassettes'
++#  c.hook_into :webmock
++#end
+ 
+ def test_github_login
+   ENV.fetch 'OCTOKIT_TEST_GITHUB_LOGIN', 'api-padawan'
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a06f631
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+01_disable_simplecov-html.diff
+02_disable_webmock.diff
+03_disable_vcr.diff
diff --git a/debian/ruby-tests.rb b/debian/ruby-tests.rb
index eac5ce6..d374597 100644
--- a/debian/ruby-tests.rb
+++ b/debian/ruby-tests.rb
@@ -1,13 +1,2 @@
-# FIXME
-# there's a spec/ or a test/ directory in the upstream source, but
-# no test suite was defined in the Gem specification. It would be
-# a good idea to define it here so the package gets tested at build time.
-# Examples:
-# $: << 'lib' << '.'
-# Dir['{spec,test}/**/*.rb'].each { |f| require f }
-#
-# require 'test/ts_foo.rb'
-#
-# require 'rbconfig'
-# ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
-# exec("#{ruby} -I. test/runtests.rb")
+$: << 'spec'  << '.'
+Dir['{spec,test}/**/*.rb'].each { |f| require f }
diff --git a/debian/rules b/debian/rules
index 82ddc0c..978ce74 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,3 +13,7 @@
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_clean:
+	dh_auto_clean
+	-rm -rf coverage/

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



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