-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set the application up to run an RSpec test suite
The application generators add much of the code we need to run RSpec, but we need to make a few tweaks to make writing and running new tests easier. We also add a `ci` rake task to let us easily start solr & fedora and run the whole test suite.
- Loading branch information
Showing
3 changed files
with
105 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
unless Rails.env.production? | ||
APP_ROOT = File.dirname(__FILE__) | ||
require "solr_wrapper" | ||
require "fcrepo_wrapper" | ||
require 'solr_wrapper/rake_task' | ||
|
||
desc "Run Continuous Integration" | ||
task :ci do | ||
ENV["environment"] = "test" | ||
solr_params = { | ||
port: 8985, | ||
verbose: true, | ||
managed: true | ||
} | ||
fcrepo_params = { | ||
port: 8986, | ||
verbose: true, | ||
managed: true, | ||
enable_jms: false, | ||
fcrepo_home_dir: 'tmp/fcrepo4-test-data' | ||
} | ||
SolrWrapper.wrap(solr_params) do |solr| | ||
solr.with_collection( | ||
name: "hydra-test", | ||
persist: false, | ||
dir: Rails.root.join("solr", "config") | ||
) do | ||
FcrepoWrapper.wrap(fcrepo_params) do | ||
Rake::Task["spec"].invoke | ||
end | ||
end | ||
end | ||
# Rake::Task["doc"].invoke | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters