mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
Add spec test for formatting hashes
This commit is contained in:
parent
f15df69eef
commit
a0b0016bcd
1 changed files with 16 additions and 0 deletions
|
|
@ -15,4 +15,20 @@ describe Utils do
|
||||||
expect(Utils.format_hosts(JSON.parse(@hostname_hash))).to eq @format_hash
|
expect(Utils.format_hosts(JSON.parse(@hostname_hash))).to eq @format_hash
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#generate_os_hash" do
|
||||||
|
before :each do
|
||||||
|
@host_hash = {"centos"=>1, "debian"=>5, "windows"=>1}
|
||||||
|
end
|
||||||
|
|
||||||
|
it "takes an array of os arguments and returns a formatted hash" do
|
||||||
|
host_arg = ["centos", "debian=5", "windows=1"]
|
||||||
|
expect(Utils.generate_os_hash(host_arg)).to eq @host_hash
|
||||||
|
end
|
||||||
|
|
||||||
|
it "returns an empty hash if there are no arguments provided" do
|
||||||
|
host_arg = []
|
||||||
|
expect(Utils.generate_os_hash(host_arg)).to be_empty
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue