mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(spec) Add format spec test
This commit is contained in:
parent
ac12ea69c1
commit
b62cffa2cd
3 changed files with 20 additions and 2 deletions
18
spec/vmfloaty/format_spec.rb
Normal file
18
spec/vmfloaty/format_spec.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
require 'spec_helper'
|
||||
require 'json'
|
||||
require_relative '../../lib/vmfloaty/format'
|
||||
|
||||
describe Pooler 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(Format.get_hosts(JSON.parse(@hostname_hash))).to eq @format_hash
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue