1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 USE_RUBY="ruby23 ruby24 ruby25"
7 RUBY_FAKEGEM_TASK_TEST="none"
8 RUBY_FAKEGEM_RECIPE_DOC="rdoc"
10 RUBY_FAKEGEM_EXTRADOC="Changelog.md README.md"
12 # Also install this custom path since internal paths depend on it.
13 RUBY_FAKEGEM_EXTRAINSTALL="exe"
15 RUBY_FAKEGEM_GEMSPEC="rspec-core.gemspec"
17 inherit ruby-fakegem versionator
19 DESCRIPTION="A Behaviour Driven Development (BDD) framework for Ruby"
20 HOMEPAGE="https://github.com/rspec/rspec-core"
21 SRC_URI="https://github.com/rspec/${PN}/archive/v${PV}.tar.gz -> ${P}-git.tgz"
25 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
28 SUBVERSION="$(get_version_component_range 1-2)"
31 =dev-ruby/rspec-support-${SUBVERSION}*
32 !!<dev-ruby/rspec-core-2.14.8-r4
33 highlight? ( >=dev-ruby/coderay-1.0.9 )
36 ruby_add_bdepend "test? (
37 >=dev-ruby/nokogiri-1.5.2
38 >=dev-ruby/coderay-1.0.9
40 >=dev-ruby/thread_order-1.1.0
41 >=dev-ruby/rspec-expectations-3.3.0:3
42 >=dev-ruby/rspec-mocks-2.99.0:3
46 # Don't set up bundler: it doesn't understand our setup.
47 sed -i -e '/[Bb]undler/d' Rakefile || die
49 # Avoid dependency on cucumber since we can't run the features anyway.
50 sed -i -e '/[Cc]ucumber/ s:^:#:' Rakefile || die
52 # Duplicate exe also in bin. We can't change it since internal stuff
53 # also depends on this and fixing that is going to be fragile. This
54 # way we can at least install proper bin scripts.
57 # Avoid unneeded dependency on git.
58 sed -i -e 's/git ls-files --/find/' rspec-core.gemspec || die
60 # Avoid aruba dependency so that we don't end up in dependency hell.
61 sed -i -e '/ArubaLoader/,/^end/ s:^:#:' -e '/Aruba/ s:^:#:' spec/spec_helper.rb || die
62 rm -f spec/support/aruba_support.rb || die
63 rm -f spec/integration/{failed_line_detection,filtering,order,persistence_failures,suite_hooks_errors}_spec.rb || die
64 rm -f spec/integration/{spec_file_load_errors,output_stream,fail_if_no_examples}_spec.rb || die
66 # Avoid a spec failing due to path issues
67 sed -i -e '/does not load files in the default path when run by ruby/,/end/ s:^:#:' \
68 spec/rspec/core/configuration_spec.rb || die
70 # Work around coderay incompatibilities
71 sed -i -e '/be_highlighted/,/end/ s/32/33/' \
72 -e '/highlights core RSpec keyword-like methods/,/^ end/ s:^:#:' \
73 spec/rspec/core/formatters/syntax_highlighter_spec.rb || die
75 # Avoid a spec that depens on dev-ruby/rspec to lessen circular
76 # dependencies, bug 662328
77 sed -i -e '/loads mocks and expectations when the constants are referenced/askip "gentoo: bug 662328"' spec/rspec/core_spec.rb || die
81 sed -i -e 's:ruby -e:'${RUBY}' -e:' spec/rspec/core_spec.rb || die
85 # # The rubygems version bundled with ruby 2.2 causes warnings.
86 # sed -i -e '/a library that issues no warnings when loaded/,/^ end/ s:^:#:' spec/rspec/core_spec.rb || die
92 PATH="${S}/bin:${PATH}" RUBYLIB="${S}/lib" ${RUBY} -Ilib bin/rspec spec || die "Tests failed."
98 ruby_fakegem_binwrapper rspec /usr/bin/rspec-3 'gem "rspec", "~>3.0"'