dev-ruby/fakeweb: amd64 stable ruby21 revision
[gentoo.git] / dev-ruby / fakeweb / fakeweb-1.3.0-r2.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 # ruby22 -> not compatible with new net/http implementation
8 USE_RUBY="ruby20 ruby21"
9
10 RUBY_FAKEGEM_DOCDIR="html"
11 RUBY_FAKEGEM_EXTRADOC="CHANGELOG README.rdoc"
12
13 inherit ruby-fakegem
14
15 DESCRIPTION="Helper for faking web requests in Ruby"
16 HOMEPAGE="https://github.com/chrisk/fakeweb"
17
18 LICENSE="GPL-2"
19 SLOT="0"
20 KEYWORDS="~alpha amd64 ~arm ~ppc ~ppc64 ~x86"
21 IUSE=""
22
23 ruby_add_bdepend "
24         test? (
25                 dev-ruby/mocha:0.14
26                 dev-ruby/test-unit
27                 dev-ruby/samuel
28                 dev-ruby/right_http_connection
29         )"
30
31 all_ruby_prepare() {
32         # The package bundles samuel and right_http_connection, remove
33         # them and use the packages instead.
34         rm -r test/vendor || die "failed to remove bundled gems"
35
36         # We don't package sdoc and we don't have the direct template.
37         sed -i -e 's/sdoc/rdoc/' -e '/template/d' Rakefile || die
38
39         # Require an old enough version of mocha
40         sed -i -e '1igem "mocha", "~> 0.14.0"' test/test_helper.rb || die
41
42         # Use the test-unit gem to make jruby compatible with newer mocha.
43         sed -i -e '1igem "test-unit"' test/test_helper.rb || die
44 }
45
46 each_ruby_prepare() {
47         case ${RUBY} in
48                 *ruby2[01])
49                         # Tests fail on mocking of TCPSocket, but fakeweb itself
50                         # actually works as evidenced by the thor test suite.
51                         rm test/test_fake_web_open_uri.rb test/test_allow_net_connect.rb test/test_fake_web.rb || die
52                         ;;
53         esac
54 }