From 6c452b6405778ab3a11c15ad4bf922fa6b6e64ae Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Wed, 11 Nov 2015 09:40:34 -0600 Subject: [PATCH] Fix unit tests Minor issue with stubs white space cleanup Change-Id: Ib871bdda15a1e83a6b21bf41cdeb28dfa4ed89a0 --- attributes/default.rb | 2 +- providers/disk.rb | 2 +- spec/ring-script_spec.rb | 2 +- spec/spec_helper.rb | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 843fbf9..c52992e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -198,7 +198,7 @@ default['openstack']['object-storage']['statistics']['sample_rate'] = 1 # # if no servers with the role below can be found then # 127.0.0.1 will be used -default['openstack']['object-storage']['statistics']['graphing_ip'] = nil +default['openstack']['object-storage']['statistics']['graphing_ip'] = nil default['openstack']['object-storage']['statistics']['graphing_role'] = 'graphite-role' default['openstack']['object-storage']['statistics']['graphing_interface'] = 'eth0' diff --git a/providers/disk.rb b/providers/disk.rb index 3f84076..eb82622 100644 --- a/providers/disk.rb +++ b/providers/disk.rb @@ -164,7 +164,7 @@ action :ensure_exists do next end - req_size = params[:size] # size in Mb - convert to blocks + req_size = params[:size] # size in Mb - convert to blocks if req_size == :remaining req_size = disk_blocks - current_block else diff --git a/spec/ring-script_spec.rb b/spec/ring-script_spec.rb index 50a18fb..168bcce 100644 --- a/spec/ring-script_spec.rb +++ b/spec/ring-script_spec.rb @@ -4,7 +4,7 @@ require_relative 'spec_helper' describe 'openstack-object-storage::ring-repo' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } let(:events) { Chef::EventDispatch::Dispatcher.new } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 52152a5..db46fcc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -49,6 +49,8 @@ MOCK_NODE_NETWORK_DATA = shared_context 'swift-stubs' do before do + stub_command('dpkg -s memcached').and_return(true) + stub_command('getent passwd memcache').and_return(true) stub_command('/usr/bin/id swift').and_return(true) stub_command('[ -x /etc/swift/pull-rings.sh ]').and_return(true) stub_command('[ -f /etc/rsyncd.conf ]').and_return(true)