Skip to content

For Contributors

Mark Bussey edited this page May 6, 2016 · 15 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. Run the tests
    rake ci

    This rake task:
    1. creates the test app in .internal_test_app
    2. spins up solr (in solr_wrapper)
    3. spins up fedora (in fcrepo_wrapper)
    4. imports fixtures
    5. runs rspec
    6. kills solr & fedora

More Detailed Instructions & Notes

test wrappers

In order to test the gem during development, you need to run solr and fedora instances using solr_wrapper and fcrepo_wrapper. The `rake ci` task automatically spins up test instances of these two services on randomly assigned test ports.

Testing the gem

[TODO] UPDATE THESE INSTRUCTIONS TO REFLECT THE CHANGE TO ENGINE_CART

The gem must be tested within the context of a Rails ~3~ 4 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:

rake spec SPEC=spec/controllers/catalog_controller_spec.rb  # path to the spec file you wish to run
Clone this wiki locally