aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:39:32 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-18 10:50:32 +0100
commit5a81f56783c256fa0617e6bf47ea38f643f045fd (patch)
tree956a274e6354e4304ced0646602724eafa734c86
parent85f938099ff816beba21e7a362909d7e82f61eb3 (diff)
downloadguix-5a81f56783c256fa0617e6bf47ea38f643f045fd.tar
guix-5a81f56783c256fa0617e6bf47ea38f643f045fd.tar.gz
gnu: Add ruby-rspec-its.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch22
-rw-r--r--gnu/packages/ruby.scm41
3 files changed, 64 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index fbdb309896..16d58b9806 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1081,6 +1081,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/rxvt-unicode-escape-sequences.patch \
%D%/packages/patches/scheme48-tests.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 a5f90d66c9..2ebb03526d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -5152,3 +5152,44 @@ in standard Ruby syntax.")
`(#: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 (search-patches "ruby-rspec-its-remove-rspec-gemspec.patch"))))
+ (build-system ruby-build-system)
+ (arguments
+ `(#:tests? #f
+ #:test-target "spec"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'fix-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)))