riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

Rails generator doesn't add code to stop test server #309

Closed nathanl closed 11 years ago

nathanl commented 11 years ago

I'm using Rails and Rspec. Running rails g ripple adds the following to spec_helper:

config.before(:suite) { Ripple::TestServer.setup }
config.after(:each) { Ripple::TestServer.clear }

However, it does not insert a statement to stop the test server:

config.after :suite { Ripple::TestServer.instance.stop }

This leaves the test server running. Besides eating resources, this can cause weird behavior. In our case, tests in Project A ran on one machine and failed with a Riak refusal to connect on another. This was because the app being tested didn't set up the test server at all, but on the machine where the tests ran worked, a test server was still running from a different app.

As a side note, it's confusing to have to use .instance to stop the server but not to clear it.

adamhunter commented 11 years ago

This is all set as per #318