Load `mocha/api` in order to cleanly integrate with rspec

The newest versions of the Mocha library require that we load `mocha/api` when
integrating with a non-core test library.  Given we use rspec exclusively,
this updates the code to match their polite request.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Strip the config testing out of the persistence layers test suite

The acceptance tests for the data object still made assertions about the
configuration; this eliminates that, now that we have separated it from the
persistence layer.

All the testing that this performed has also been ported to the regular unit
test suite, so there is no loss in eliminating this change.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Eliminate use of config through the persistence layer in tests

The acceptance suite had a bunch of uses of the configuration data through the
persistence layer that, for some crazy reason, didn't show up in my earlier
test runs.

This eliminates those, allowing the tests to actually pass when fully run,
after the initial work disentangling the two concepts in the code.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Migrate MK boot policy tests from acceptance to unit framework

This copies the tests of the Microkernel boot policy tool into the unit test
suite, rather than the acceptance test suite.  The same tests are performed,
but now in a way that doesn't depend on the rest of the infrastructure of a
fully operational Razor installation.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Update tag slice tests to work regardless of IP in configuration file

The tag slice acceptance tests were trusting the content of the Razor
configuration file to locate their next step - even if that was mutable state
changed by other tests.

This updates them to simply assume the Razor instance they are testing is
running on localhost in *all* of their URLs, rather than just the ones that
start the testing process.

This ensures that the tests pass with less need to assume a previous test has
reset configuration on disk to the system defaults.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Fix in-memory persistence layer collection handling

The in-memory persistence layer was implemented with some incoherence, and
handled indexing to locate a specific document incorrectly.  It tried to treat
an array of all instances as a hash, rather than finding the record directly
in memory.

As a side effect I was able to delete a few extra lines of code by eliminating
one stateful variable, and using a Ruby feature to fill in blank values in the
target hash appropriately.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Add basic test for `razor policy add`

This adds a basic unit test for the policy slice, around adding a new record;
it attempts to validate the end to end success case, inspired by the failure
noted in #431 - our existing tests didn't discover the failure mode for
configuration access in an inappropriate location.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Fix the server configuration spec for the in-memory persistence update

The configuration object in Razor is stateful.  This means that change
propagates between our tests freely, if they run in the same Ruby VM, and we
end up with the "use in-memory persistence" configuration in the global
helpers causing failures in the config specs.

To combat this the global state is now reset in the configuration code tests,
to ensure that we continue to enter them in the state that we believe we
should be in.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Merge pull request #433 from daniel-pittman/bug/master/431-razor-policy-add-fails-after-config-cleanups

#431 razor policy add fails after config cleanups