Skip to content
jcoyne edited this page Nov 28, 2012 · 8 revisions

For Contributors to the Hydra-Head Gem

Testing the Gem

For the Impatient

  1. Clone the Hydra-Head code (to a fresh working copy)
    git clone [email protected]:projecthydra/hydra-head.git
  2. Switch to the hydra-head directory
    cd hydra-head
  3. Install bundler gem
    gem install bundler
  4. Get the project dependencies
    bundle install
  5. Grab the jetty submodule
    git submodule init; git submodule update
  6. Run the tests
    rake ci

    This rake task:
    1. creates the test apps in hydra-core/spec/internal and hydra-file-access/spec/internal
    2. spins up jetty (in jettywrapper)
    3. imports fixtures
    4. runs rspec
    5. kills jetty (in jettywrapper)

More Detailed Instructions & Notes

Hydra-Jetty

In order to test the gem during development, the hydra-jetty is included as a submodule to provide both a fedora and solr instance. Once you have cloned the github repository, run the following commands to load hydra-jetty:

git submodule init
git submodule update

To start jetty:

rake jetty:start

Note: the first time you start hydra-jetty, you must use the following command in order to properly configure jetty:

rake hydra:jetty:load

Testing the gem

The gem must be tested within the context of a Rails 3 application.

A rake task is provided for setting up a rails 3 test app in the hydra-core/spec/internal and hydra-file-access/spec/internal directories. To generate the app, run:

rake generate

The specs fixtures for testing the Hydra-Head gem are all contained within the spec/support directories of the gems. Once you have installed the test app and have Hydra-Jetty running, you will be able to run the specs for each gem via the provided rake tasks.

In order to run a single spec use the following from the command line:

export RAILS_ROOT="spec/internal"
rspec spec/controllers/catalog_controller_spec.rb  # path to the spec file you wish to run