From 2150630744cebd250084a4b37851bcaad5b3188f Mon Sep 17 00:00:00 2001 From: Ben Woodcroft Date: Mon, 5 Feb 2018 11:39:32 +0100 Subject: gnu: Add ruby-rspec-its. --- gnu/local.mk | 1 + .../ruby-rspec-its-remove-rspec-gemspec.patch | 22 +++++++++ gnu/packages/ruby.scm | 55 ++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9e875263ac..78ea61c4cc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1113,6 +1113,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-bootstrap-stage0-test.patch \ %D%/packages/patches/rust-coresimd-doctest.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 1163a869d8..a1b444ce68 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -5265,3 +5265,58 @@ gson.rb, JrJackson, and OkJson.") `(#:tests? #f)) (native-inputs `()))) + +(define-public ruby-rspec-its + (package + (name "ruby-rspec-its") + (version "1.2.0") + (source + (origin + (method url-fetch) + ;; 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 + "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 + `(#: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))) + (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))) -- cgit v1.2.3