Sha256: 9c8dc737dd30ed6aea3a16756e6a39f9de77ce3835c8e3d1604f11fc613405dc
Contents?: true
Size: 1.17 KB
Versions: 33
Compression:
Stored size: 1.17 KB
Contents
require "spec_helper" module Beaker module Options describe HostsFileParser do let(:parser) {HostsFileParser} let(:filepath) {File.join(File.expand_path(File.dirname(__FILE__)), "data", "hosts.cfg")} it "can correctly read a host file" do FakeFS.deactivate! config = parser.parse_hosts_file(filepath) expect(config).to be === {:HOSTS=>{:"pe-ubuntu-lucid"=>{:roles=>["agent", "dashboard", "database", "master"], :vmname=>"pe-ubuntu-lucid", :platform=>"ubuntu-10.04-i386", :snapshot=>"clean-w-keys", :hypervisor=>"fusion"}, :"pe-centos6"=>{:roles=>["agent"], :vmname=>"pe-centos6", :platform=>"el-6-i386", :hypervisor=>"fusion", :snapshot=>"clean-w-keys"}}, :nfs_server=>"none", :consoleport=>443} end it "can merge CONFIG section into overall hash" do FakeFS.deactivate! config = parser.parse_hosts_file(filepath) expect(config['CONFIG']).to be === nil expect(config['consoleport']).to be === 443 end it "raises an error on no file found" do FakeFS.deactivate! expect{parser.parse_hosts_file("not a valid path")}.to raise_error(ArgumentError) end end end end
Version data entries
33 entries across 33 versions & 1 rubygems