diff options
author | Ben Woodcroft <donttrustben@gmail.com> | 2018-02-05 11:39:32 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-12-28 11:21:18 +0000 |
commit | 9cf6d5e1b75b57ce63234e028ccf86e3c6f61078 (patch) | |
tree | 64148d805b6d79b7c39b0b19dc3f58675f2bcbbe /gnu | |
parent | d8fe045b7bef3b02291ba9ef1022677d765c9c7b (diff) | |
download | guix-9cf6d5e1b75b57ce63234e028ccf86e3c6f61078.tar guix-9cf6d5e1b75b57ce63234e028ccf86e3c6f61078.tar.gz |
gnu: Enable tests for ruby-rspec-its.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch | 22 | ||||
-rw-r--r-- | gnu/packages/ruby.scm | 44 |
3 files changed, 61 insertions, 6 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 925d955a66..546d552cc5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1140,6 +1140,7 @@ dist_patch_DATA = \ %D%/packages/patches/ruby-concurrent-ignore-broken-test.patch \ %D%/packages/patches/ruby-concurrent-test-arm.patch \ %D%/packages/patches/ruby-rack-ignore-failing-test.patch \ + %D%/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch\ %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ %D%/packages/patches/rust-1.19-mrustc.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ diff --git a/gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch b/gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch new file mode 100644 index 0000000000..901eb88d21 --- /dev/null +++ b/gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch @@ -0,0 +1,22 @@ +diff --git a/Gemfile b/Gemfile +index 9786991..bec005d 100644 +--- a/Gemfile ++++ b/Gemfile +@@ -3,17 +3,6 @@ source 'https://rubygems.org' + # Specify your gem's dependencies in rspec-its.gemspec + gemspec + +-%w[rspec rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib| +- branch = ENV.fetch('BRANCH','3-1-maintenance') +- library_path = File.expand_path("../../#{lib}", __FILE__) +- if File.exist?(library_path) +- gem lib, :path => library_path +- else +- gem lib, :git => "git://github.com/rspec/#{lib}.git", +- :branch => branch +- end +-end +- + # test coverage + # gem 'simplecov', :require => false + diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index e4f8c72bcb..3c235bc107 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -456,19 +456,51 @@ outcomes of a code example.") (source (origin (method url-fetch) - (uri (rubygems-uri "rspec-its" version)) + ;; Use GitHub as a source because otherwise we cannot patch directly + (uri (string-append "https://github.com/rspec/rspec-its/archive/v" + version ".tar.gz")) (sha256 (base32 - "1pwphny5jawcm1hda3vs9pjv1cybaxy17dc1s75qd7drrvx697p3")))) + "088f3y7vd3c8g2gpi0z76qabaabfg0fb70ly3d0xqzbani0lrf09")) + (patches + (list + (origin (method url-fetch) + (uri (string-append + "https://github.com/rspec/rspec-its/commit/" + "bfaab439c7c879f5ef25552f41827891f6308373.patch")) + (file-name "ruby-rspec-its-fix-specs-for-ruby-2.4.patch") + (sha256 + (base32 + "0lnik0kvrpgkakvdb2fmzg22pdlraf6kiidr9sv6rnfyviiqwxgh"))))))) (build-system ruby-build-system) (arguments - `(#:tests? #f)) ; needs cucumber. + `(#:test-target "spec" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'dont-install-gems-from-gemfile + (lambda _ + (substitute* "Gemfile" + (("rspec rspec-core rspec-expectations rspec-mocks rspec-support") + "")) + #t)) + (add-before 'check 'remove-unnecessary-dependency-versions-from-gemfile + (lambda _ + (substitute* "rspec-its.gemspec" + (("rake.*") "rake'\n") + (("cucumber.*") "cucumber'\n")) + #t))))) (propagated-inputs `(("ruby-rspec-core" ,ruby-rspec-core) ("ruby-rspec-expectations" ,ruby-rspec-expectations))) - (synopsis "RSpec extension gem for attribute matching") - (description "@code{rspec-its} is an RSpec extension gem for attribute -matching.") + (native-inputs + `(("bundler" ,bundler) + ("ruby-cucumber" ,ruby-cucumber) + ("ruby-aruba" ,ruby-aruba))) + (synopsis "RSpec extension that provides the @code{its} method") + (description + "RSpec::Its provides the its method as a short-hand to specify the expected +value of an attribute. For example, one can use @code{its(:size)\\{should +eq(1)\\}}.") (home-page "https://github.com/rspec/rspec-its") (license license:expat))) |