aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:39:32 +0100
committerChristopher Baines <mail@cbaines.net>2018-03-18 18:25:03 +0000
commit828b82cbfc37dc4482dc37e79c4889bea5cd3817 (patch)
tree7f0b270bdef6aadb7bac2db40ca5dc7d6a38123b
parentc20633d2fcc297c2f44db851e94a3868c18fb084 (diff)
downloadguix-828b82cbfc37dc4482dc37e79c4889bea5cd3817.tar
guix-828b82cbfc37dc4482dc37e79c4889bea5cd3817.tar.gz
gnu: Add ruby-rspec-its.
-rw-r--r--gnu/packages/patches/ruby-rspec-its-remove-rspec-gemspec.patch22
-rw-r--r--gnu/packages/ruby.scm41
2 files changed, 63 insertions, 0 deletions
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 86206ecfd6..b0ad986044 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)))