Skip to content

Commit

Permalink
Merge branch 'rm-null-obj-warnings'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsdeleo committed Jul 26, 2011
2 parents fa78729 + 6eeaf0e commit 12893ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chef/spec/unit/provider/package/apt_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# #


require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "spec_helper")) require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "spec_helper"))
require 'ostruct'


describe Chef::Provider::Package::Apt do describe Chef::Provider::Package::Apt do
before(:each) do before(:each) do
Expand All @@ -30,14 +31,14 @@
@provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context) @provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context)
Chef::Resource::Package.stub!(:new).and_return(@current_resource) Chef::Resource::Package.stub!(:new).and_return(@current_resource)
@provider.stub!(:popen4).and_return(@status) @provider.stub!(:popen4).and_return(@status)
@stdin = mock("STDIN", :null_object => true) @stdin = StringIO.new
@stdout =<<-PKG_STATUS @stdout =<<-PKG_STATUS
Package: irssi Package: irssi
State: not installed State: not installed
Version: 0.8.12-7 Version: 0.8.12-7
PKG_STATUS PKG_STATUS
@stderr = mock("STDERR", :null_object => true) @stderr = StringIO.new
@pid = mock("PID", :null_object => true) @pid = 12345
@shell_out = OpenStruct.new(:stdout => @stdout,:stdin => @stdin,:stderr => @stderr,:status => @status,:exitstatus => 0) @shell_out = OpenStruct.new(:stdout => @stdout,:stdin => @stdin,:stderr => @stderr,:status => @status,:exitstatus => 0)
end end


Expand Down Expand Up @@ -112,7 +113,6 @@
VPKG_STDOUT VPKG_STDOUT
virtual_package = mock(:stdout => virtual_package_out,:exitstatus => 0) virtual_package = mock(:stdout => virtual_package_out,:exitstatus => 0)
@provider.should_receive(:shell_out!).with("aptitude show libmysqlclient-dev").and_return(virtual_package) @provider.should_receive(:shell_out!).with("aptitude show libmysqlclient-dev").and_return(virtual_package)
real_package_out=mock("STDOUT", :null_object => true)
real_package_out =<<-REALPKG_STDOUT real_package_out =<<-REALPKG_STDOUT
Package: libmysqlclient15-dev Package: libmysqlclient15-dev
State: not installed State: not installed
Expand Down

0 comments on commit 12893ae

Please sign in to comment.