mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-27 05:48:41 -05:00
Cleanup vmfloaty library and command line functions
This commit is contained in:
parent
c1689da3c4
commit
c6cf86669a
5 changed files with 87 additions and 67 deletions
18
spec/vmfloaty/utils_spec.rb
Normal file
18
spec/vmfloaty/utils_spec.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
require 'spec_helper'
|
||||
require 'json'
|
||||
require_relative '../../lib/vmfloaty/utils'
|
||||
|
||||
describe Utils do
|
||||
|
||||
describe "#get_hosts" do
|
||||
before :each do
|
||||
@hostname_hash = "{\"ok\":true,\"debian-7-i386\":{\"hostname\":[\"sc0o4xqtodlul5w\",\"4m4dkhqiufnjmxy\"]},\"debian-7-x86_64\":{\"hostname\":\"zb91y9qbrbf6d3q\"},\"domain\":\"company.com\"}"
|
||||
@format_hash = "{\"debian-7-i386\":[\"sc0o4xqtodlul5w\",\"4m4dkhqiufnjmxy\"],\"debian-7-x86_64\":\"zb91y9qbrbf6d3q\",\"domain\":\"company.com\"}"
|
||||
end
|
||||
|
||||
it "formats a hostname hash into os, hostnames, and domain name" do
|
||||
|
||||
expect(Utils.format_hosts(JSON.parse(@hostname_hash))).to eq @format_hash
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue