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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user