diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-08-13 21:18:41 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-08-13 21:18:41 +0000 |
commit | fe2a62a5a1cc84ee5014e322052095d4edbfd0b1 (patch) | |
tree | d0914356cc81926fbbc0d033fbb63f666731996a /eclass | |
parent | Update metadata.xml boost use flag description (diff) | |
download | gentoo-2-fe2a62a5a1cc84ee5014e322052095d4edbfd0b1.tar.gz gentoo-2-fe2a62a5a1cc84ee5014e322052095d4edbfd0b1.tar.bz2 gentoo-2-fe2a62a5a1cc84ee5014e322052095d4edbfd0b1.zip |
Add a cucumber wrapper similar to the rspec one we have already.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/ruby-ng.eclass | 33 |
2 files changed, 36 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index cec5cf92bbf7..8a1417a65328 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.366 2012/08/13 15:54:08 mabi Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.367 2012/08/13 21:18:41 flameeyes Exp $ + + 13 Aug 2012; Diego E. Pettenò <flameeyes@gentoo.org> ruby-ng.eclass: + Add a cucumber wrapper similar to the rspec one we have already. 13 Aug 2012; Matti Bickel <mabi@gentoo.org> fox.eclass: Add updated info statement about fox17.pc re bug #426718 diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 10034a534d54..d71fc31b3561 100644 --- a/eclass/ruby-ng.eclass +++ b/eclass/ruby-ng.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.48 2012/07/08 12:38:10 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.49 2012/08/13 21:18:41 flameeyes Exp $ # @ECLASS: ruby-ng.eclass # @MAINTAINER: @@ -659,6 +659,37 @@ ruby-ng_rspec() { ${RUBY} -S rspec ${rspec_params} "$@" || die "rspec failed" } +# @FUNCTION: ruby-ng_cucumber +# @DESCRIPTION: +# This is simply a wrapper around the cucumber command (executed by $RUBY}) +# which also respects TEST_VERBOSE and NOCOLOR environment variables. +ruby-ng_cucumber() { + if [[ ${DEPEND} != *"dev-util/cucumber"* ]]; then + ewarn "Missing dev-util/cucumber in \${DEPEND}" + fi + + local cucumber_params= + case ${NOCOLOR} in + 1|yes|true) + cucumber_params+=" --no-color" + ;; + *) + cucumber_params+=" --color" + ;; + esac + + case ${TEST_VERBOSE} in + 1|yes|true) + cucumber_params+=" --format pretty" + ;; + *) + cucumber_params+=" --format progress" + ;; + esac + + ${RUBY} -S cucumber ${cucumber_params} "$@" || die "cucumber failed" +} + # @FUNCTION: ruby-ng_testrb-2 # @DESCRIPTION: # This is simply a replacement for the testrb command that load the test |