Added dashboard_stubs

Following a pattern already laid out in other cookbooks.
Invoke a common stub method before each test.

Change-Id: Ib52afd39b299b85db74a28182dd8d7e35138f91d
This commit is contained in:
John Dewey
2013-06-08 22:09:42 -07:00
parent a38ff0a276
commit bfdfa3819c
5 changed files with 11 additions and 26 deletions

View File

@@ -1,14 +1,7 @@
require_relative "spec_helper"
describe "openstack-dashboard::server" do
before do
::Chef::Recipe.any_instance.stub(:memcached_servers).
and_return ["hostA:port", "hostB:port"]
::Chef::Recipe.any_instance.stub(:db_password).with("horizon").
and_return "test-pass"
end
# Fedora doesn't seem to be supported by fauxhai.
before { dashboard_stubs }
#describe "fedora" do
# before do

View File

@@ -1,12 +1,7 @@
require_relative "spec_helper"
describe "openstack-dashboard::server" do
before do
::Chef::Recipe.any_instance.stub(:memcached_servers).
and_return []
::Chef::Recipe.any_instance.stub(:db_password).with("horizon").
and_return "test-pass"
end
before { dashboard_stubs }
describe "opensuse" do
context "mysql backend" do

View File

@@ -1,12 +1,7 @@
require_relative "spec_helper"
describe "openstack-dashboard::server" do
before do
::Chef::Recipe.any_instance.stub(:memcached_servers).
and_return ["hostA:port", "hostB:port"]
::Chef::Recipe.any_instance.stub(:db_password).with("horizon").
and_return "test-pass"
end
before { dashboard_stubs }
describe "redhat" do
before do

View File

@@ -1,12 +1,7 @@
require_relative "spec_helper"
describe "openstack-dashboard::server" do
before do
::Chef::Recipe.any_instance.stub(:memcached_servers).
and_return ["hostA:port", "hostB:port"]
::Chef::Recipe.any_instance.stub(:db_password).with("horizon").
and_return "test-pass"
end
before { dashboard_stubs }
describe "ubuntu" do
before do

View File

@@ -16,3 +16,10 @@ require "chefspec"
:version => "12.3",
:log_level => ::LOG_LEVEL
}
def dashboard_stubs
::Chef::Recipe.any_instance.stub(:memcached_servers).
and_return ["hostA:port", "hostB:port"]
::Chef::Recipe.any_instance.stub(:db_password).with("horizon").
and_return "test-pass"
end