Class: Ripple::TestServer
- Includes:
- Singleton
- Defined in:
- lib/ripple/test_server.rb
Overview
Extends the Riak::TestServer to be aware of the Ripple configuration and adjust settings appropriately. Also simplifies its usage in the generation of test helpers.
Class Method Summary collapse
-
.clear ⇒ Object
Clears data from the test server.
-
.setup ⇒ Object
Creates and starts the test server.
Instance Method Summary collapse
-
#initialize(options = Ripple.config.dup) ⇒ TestServer
constructor
A new instance of TestServer.
Constructor Details
#initialize(options = Ripple.config.dup) ⇒ TestServer
Returns a new instance of TestServer.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ripple/test_server.rb', line 23 def initialize(=Ripple.config.dup) [:env] ||= {} [:env][:riak_kv] ||= {} [:env][:riak_kv][:js_source_dir] ||= Ripple.config.delete(:js_source_dir) [:env][:riak_kv][:map_cache_size] ||= 0 [:env][:riak_core] ||= {} [:env][:riak_core][:http] ||= [ Tuple[Ripple.config[:host], Ripple.config[:http_port]] ] [:env][:riak_kv][:pb_port] ||= Ripple.config[:pb_port] [:env][:riak_kv][:pb_ip] ||= Ripple.config[:host] super() end |
Class Method Details
.clear ⇒ Object
Clears data from the test server
18 19 20 |
# File 'lib/ripple/test_server.rb', line 18 def self.clear instance.drop end |
.setup ⇒ Object
Creates and starts the test server
12 13 14 15 |
# File 'lib/ripple/test_server.rb', line 12 def self.setup instance.create instance.start end |