Skip to content

Instantly share code, notes, and snippets.

@thommay
Created February 18, 2009 21:42
Show Gist options
  • Save thommay/66566 to your computer and use it in GitHub Desktop.
Save thommay/66566 to your computer and use it in GitHub Desktop.
describe "with a client SSL cert" do
before(:each) do
@cert = File.join(File.dirname(__FILE__), "..", "data", "client-cert.pem")
@key = File.join(File.dirname(__FILE__), "..", "data", "client-cert.key")
@c = File.read(@cert)
@k = File.read(@key)
Chef::Config[:ssl_client_cert] = @cert
Chef::Config[:ssl_client_key] = @key
File.stub!(:read).with(@cert).and_return(@c)
File.stub!(:read).with(@key).and_return(@k)
end
it "should read the cert file" do
File.should_receive(:read).with(@cert).and_return(@c)
do_run_request
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment