Sha256: fbeb62ec62a6e66b7260af91281da160262d330f7033984e79aa926ab59ea092

Contents?: true

Size: 829 Bytes

Versions: 16

Compression:

Stored size: 829 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

require 'facter/util/xendomains'

describe Facter::Util::Xendomains do
  describe ".get_domains" do
    it "should return a list of running Xen Domains on Xen0" do
      sample_output_file = File.dirname(__FILE__) + '/../data/xendomains'
      xen0_domains = File.read(sample_output_file)
      Facter::Util::Resolution.stubs(:exec).with('/usr/sbin/xm list 2>/dev/null').returns(xen0_domains)
      Facter::Util::Xendomains.get_domains.should == %{web01,mailserver}
    end

    describe "when xm list isn't executable" do
      it "should be nil" do
        Facter::Util::Resolution.stubs(:exec).with('/usr/sbin/xm list 2>/dev/null').returns(nil)
        Facter::Util::Xendomains.get_domains.should == nil
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
supply_drop-0.11.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.9.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.8.1 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.8.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.7.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.6.1 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
supply_drop-0.6.0 examples/vendored-puppet/vendor/facter-1.6.4/spec/unit/util/xendomains_spec.rb
facter-1.6.4 spec/unit/util/xendomains_spec.rb
facter-1.6.3 spec/unit/util/xendomains_spec.rb
facter-1.6.2 spec/unit/util/xendomains_spec.rb
facter-1.6.1 spec/unit/util/xendomains_spec.rb
facter-1.6.0 spec/unit/util/xendomains_spec.rb
facter-1.5.9 spec/unit/util/xendomains_spec.rb