Files
cookbook-openstack-block-st…/spec/db_spec.rb
John Dewey 1e45b8e40b Tests should be using require_relative
The #require_relative statement is relative to the file
containing the the statement.

Change-Id: I032eb8384328fb478e12b6f433d3cfa2229e252a
2013-06-04 18:33:04 -07:00

25 lines
628 B
Ruby

require_relative "spec_helper"
describe "openstack-block-storage::db" do
it "installs mysql packages" do
@chef_run = converge
expect(@chef_run).to include_recipe "mysql::client"
expect(@chef_run).to include_recipe "mysql::ruby"
end
it "creates database and user" do
::Chef::Recipe.any_instance.should_receive(:db_create_with_user).
with "volume", "cinder", "test-pass"
converge
end
def converge
::Chef::Recipe.any_instance.stub(:db_password).with("cinder").
and_return "test-pass"
::ChefSpec::ChefRunner.new(::UBUNTU_OPTS).converge "openstack-block-storage::db"
end
end