spec/whm/cert_spec.rb in lumberg-2.0.0.pre4 vs spec/whm/cert_spec.rb in lumberg-2.0.0.pre5
- old
+ new
@@ -5,13 +5,13 @@
SELF_KEY = File.read('./spec/sample_certs/sample.key')
module Lumberg
describe Whm::Cert do
before(:each) do
- @login = { :host => @whm_host, :hash => @whm_hash }
+ @login = { host: @whm_host, hash: @whm_hash }
@server = Whm::Server.new(@login.dup)
- @cert = Whm::Cert.new(:server => @server.dup)
+ @cert = Whm::Cert.new(server: @server.dup)
end
describe "#listcrts" do
use_vcr_cassette "whm/cert/listcrts"
@@ -24,11 +24,11 @@
describe "#fetchsslinfo" do
use_vcr_cassette "whm/cert/fetchsslinfo"
it "displays the SSL certificate, private key, and CA bundle/intermediate certificate associated with a specified domain" do
- result = @cert.fetchsslinfo(:domain => "myhost.com", :crtdata => CERT)
+ result = @cert.fetchsslinfo(domain: "myhost.com", crtdata: CERT)
result[:success].should be_true
result[:message].should match("ok")
result[:params][:crt].should match(/.*BEGIN CERTIFICATE.*/)
result[:params][:key].should match(/.*KEY.*/)
end
@@ -38,20 +38,20 @@
use_vcr_cassette "whm/cert/generatessl"
context "generating a new CSR" do
subject do
@cert.generatessl(
- :city => "houston",
- :host => "myhost.com",
- :country => "US",
- :state => "TX",
- :company => "Company",
- :company_division => "Dept",
- :email => "test@myhost.com",
- :pass => "abc123",
- :xemail => "",
- :noemail => 1
+ city: "houston",
+ host: "myhost.com",
+ country: "US",
+ state: "TX",
+ company: "Company",
+ company_division: "Dept",
+ email: "test@myhost.com",
+ pass: "abc123",
+ xemail: "",
+ noemail: 1
)
end
its([:success]) { should be_true }
its([:message]) { should == "Key, Certificate, and CSR generated OK" }
@@ -62,20 +62,20 @@
end
context "generating a new CSR with an ampersand in company name" do
subject do
@cert.generatessl(
- :city => "houston",
- :host => "myhost.com",
- :country => "US",
- :state => "TX",
- :company => "Foo & Bar",
- :company_division => "Dept",
- :email => "test@myhost.com",
- :pass => "abc123",
- :xemail => "",
- :noemail => 1
+ city: "houston",
+ host: "myhost.com",
+ country: "US",
+ state: "TX",
+ company: "Foo & Bar",
+ company_division: "Dept",
+ email: "test@myhost.com",
+ pass: "abc123",
+ xemail: "",
+ noemail: 1
)
end
its([:success]) { should be_true }
its([:message]) { should == "Key, Certificate, and CSR generated OK" }
@@ -88,10 +88,10 @@
describe "#installssl" do
use_vcr_cassette "whm/cert/installssl"
it "installs a certificate" do
- result = @cert.installssl(:domain => 'check.com', :user => "nobody", :cert => SELF_CERT, :key => SELF_KEY, :ip => '192.1.2.3')
+ result = @cert.installssl(domain: 'check.com', user: "nobody", cert: SELF_CERT, key: SELF_KEY, ip: '192.1.2.3')
result[:success].should be_true
result[:message].should match(/Certificate successfully installed/)
end
end
end