diff options
author | Hans de Graaff <graaff@gentoo.org> | 2014-12-28 07:23:56 +0000 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2014-12-28 07:23:56 +0000 |
commit | b5a226685696a46ffe2984f9f7b466f6f4326ee6 (patch) | |
tree | 4823a403a3983cc2b74f9ee2ca916ba25ee6b7f5 /eclass | |
parent | Move stable keywords forward to a version with the rspec-2 wrapper. (diff) | |
download | gentoo-2-b5a226685696a46ffe2984f9f7b466f6f4326ee6.tar.gz gentoo-2-b5a226685696a46ffe2984f9f7b466f6f4326ee6.tar.bz2 gentoo-2-b5a226685696a46ffe2984f9f7b466f6f4326ee6.zip |
Use rspec-2 wrapper for the rspec recipe.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 8 | ||||
-rw-r--r-- | eclass/ruby-fakegem.eclass | 12 | ||||
-rw-r--r-- | eclass/ruby-ng.eclass | 19 |
3 files changed, 30 insertions, 9 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 4e75d981ae20..79589f7ef077 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1481 2014/12/27 23:52:24 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1482 2014/12/28 07:23:56 graaff Exp $ + + 28 Dec 2014; Hans de Graaff <graaff@gentoo.org> ruby-fakegem.eclass, + ruby-ng.eclass: + Use rspec-2 wrapper for the rspec recipe. This enables us to add rspec 3.x to + the tree while still being able to run rspec 2 specs. The changes have been + made in a way that is backwards compatible with the current situation. 27 Dec 2014; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass: Update banned var docs. diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass index 3ed591e681fd..50da8876e314 100644 --- a/eclass/ruby-fakegem.eclass +++ b/eclass/ruby-fakegem.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.42 2014/12/07 07:23:12 graaff Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.43 2014/12/28 07:23:56 graaff Exp $ # @ECLASS: ruby-fakegem.eclass # @MAINTAINER: @@ -141,7 +141,9 @@ case ${RUBY_FAKEGEM_RECIPE_TEST} in ;; rspec) IUSE+=" test" - ruby_add_bdepend "test? ( dev-ruby/rspec:2 )" + # Also require a new enough rspec-core version that installs the + # rspec-2 wrapper. + ruby_add_bdepend "test? ( dev-ruby/rspec:2 >=dev-ruby/rspec-core-2.14.8-r2 )" ;; cucumber) IUSE+=" test" @@ -287,7 +289,7 @@ ruby_fakegem_genspec() { # so better taking this into consideration. local quoted_description=${DESCRIPTION//\"/\\\"} cat - > $1 <<EOF -# generated by ruby-fakegem.eclass $Revision: 1.42 $ +# generated by ruby-fakegem.eclass $Revision: 1.43 $ Gem::Specification.new do |s| s.name = "${RUBY_FAKEGEM_NAME}" s.version = "${RUBY_FAKEGEM_VERSION}" @@ -340,7 +342,7 @@ ruby_fakegem_binwrapper() { #!${rubycmd} # This is a simplified version of the RubyGems wrapper # -# Generated by ruby-fakegem.eclass $Revision: 1.42 $ +# Generated by ruby-fakegem.eclass $Revision: 1.43 $ require 'rubygems' @@ -436,7 +438,7 @@ each_fakegem_test() { ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed" ;; rspec) - ruby-ng_rspec + RSPEC_VERSION=2 ruby-ng_rspec ;; cucumber) ruby-ng_cucumber diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 56b6ebb4937d..700d9e3de3c1 100644 --- a/eclass/ruby-ng.eclass +++ b/eclass/ruby-ng.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.55 2014/12/27 20:04:21 graaff Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.56 2014/12/28 07:23:56 graaff Exp $ # @ECLASS: ruby-ng.eclass # @MAINTAINER: @@ -647,11 +647,24 @@ ruby_get_implementation() { esac } -# @FUNCTION: ruby-ng_rspec +# @FUNCTION: ruby-ng_rspec <arguments> # @DESCRIPTION: # This is simply a wrapper around the rspec command (executed by $RUBY}) # which also respects TEST_VERBOSE and NOCOLOR environment variables. +# Optionally takes arguments to pass on to the rspec invocation. The +# environment variable RSPEC_VERSION can be used to control the specific +# rspec version that must be executed. It defaults to 2 for historical +# compatibility. ruby-ng_rspec() { + local version=${RSPEC_VERSION-2} + local files="$@" + + # Explicitly pass the expected spec directory since the versioned + # rspec wrappers don't handle this automatically. + if [ ${#@} -eq 0 ]; then + files="spec" + fi + if [[ ${DEPEND} != *"dev-ruby/rspec"* ]]; then ewarn "Missing dev-ruby/rspec in \${DEPEND}" fi @@ -675,7 +688,7 @@ ruby-ng_rspec() { ;; esac - ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed" + ${RUBY} -S rspec-${version} ${rspec_params} ${files} || die "rspec failed" } # @FUNCTION: ruby-ng_cucumber |