Skip to content

Instantly share code, notes, and snippets.

@duff
Created December 2, 2010 20:45
Show Gist options
  • Save duff/726023 to your computer and use it in GitHub Desktop.
Save duff/726023 to your computer and use it in GitHub Desktop.
development:
port: 8091
host: localhost
test:
port: 8098
host: localhost
bin_dir: /Users/duff/code/riak/rel/riak/bin
js_source_dir: <%= Rails.root + "lib/riak_js" %>
production:
port: 8091
host: localhost
require 'riak/test_server'
def test_server_config
{ :app_config => { :riak_kv => { :js_source_dir => Ripple.config.delete(:js_source_dir) },
:riak_core => { :web_port => Ripple.config.delete(:port) } },
:bin_dir => Ripple.config.delete(:bin_dir),
:temp_dir => Rails.root + "tmp/riak_test_server"
}
end
unless $test_server
begin
require 'yaml'
$test_server = Riak::TestServer.new(test_server_config)
$test_server.prepare!
$test_server.start
at_exit { $test_server.cleanup }
rescue => e
warn "Can't run the specs. Specify the location of your Riak installation in config/ripple.yml."
warn e.inspect
$test_server = nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment