From Fedora Project Wiki

Revision as of 10:47, 1 February 2011 by Vondruch (talk | contribs) (→‎Testsuite execution: new section)

The following metadata was found in MoinMoin that could not be converted to a useful value in MediaWiki:

  • : These two files are symlinks into %gemdir created in %install
  • acl: Known:read,write All:read

The short tutorial how to put an rpm file created with gem2rpm in compliance is here: http://lukas.zapletalovi.com/2011/01/how-to-prepare-gemfile-package-for.html

Testsuite execution

The most, if not all gems contains their test suite, which is commonly executed during build. This might be in most cases achieved by running rake task such as:

%check
rake spec

However this has some cavities. The problem is mainly that Rakefile usually contains not just the "spec" or "test" task for test suite execution, but also packaging tasks etc. These tasks usually depends on other gems, such as "Hoe". This brings in unnecessary dependencies and polution. Therefore, please prefer to execute the test suite as follows:

Test::Unit

RUBYOPT="I%{buildroot}%{geminstdir}/lib Itest" testrb test/test_*

MiniTest

RUBYOPT="I%{buildroot}%{geminstdir}/lib Itest" ruby -e "Dir.glob('test/**/test_*').each {|t| require t}"

RSpec

RUBYOPT="I%{buildroot}%{geminstdir}/lib Ispec" spec spec/


Additional notes

If the test suite has more dependencies, RUBYOPT can additionally enforce usage of RubyGems. This apply for all test frameworks mentioned above.

RUBYOPT="rubygems I%{buildroot}%{geminstdir}/lib Ispec" spec spec/