Sha256: 56887c7e4a2378d7f00f8d0e1f9ef4c7e13c113eb06ba6ee7f14de7efbe455bf

Contents?: true

Size: 705 Bytes

Versions: 26

Compression:

Stored size: 705 Bytes

Contents

#! /usr/bin/env ruby

require '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
      xen0_domains = my_fixture_read("xendomains")
      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

26 entries across 26 versions & 2 rubygems

Version Path
facter-1.7.6 spec/unit/util/xendomains_spec.rb
facter-1.7.5 spec/unit/util/xendomains_spec.rb
facter-1.7.5.rc2 spec/unit/util/xendomains_spec.rb
facter-1.7.5.rc1 spec/unit/util/xendomains_spec.rb
facter-1.7.4 spec/unit/util/xendomains_spec.rb
facter-1.7.4.rc1 spec/unit/util/xendomains_spec.rb
facter-1.7.3 spec/unit/util/xendomains_spec.rb
facter-1.7.3.rc1 spec/unit/util/xendomains_spec.rb
facter-1.7.2 spec/unit/util/xendomains_spec.rb
facter-1.7.2.rc1 spec/unit/util/xendomains_spec.rb
facter-1.7.1 spec/unit/util/xendomains_spec.rb
facter-1.7.1.rc1 spec/unit/util/xendomains_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/util/xendomains_spec.rb
facter-1.7.0 spec/unit/util/xendomains_spec.rb
facter-1.7.0.rc2 spec/unit/util/xendomains_spec.rb
facter-1.7.0.rc1 spec/unit/util/xendomains_spec.rb
facter-1.6.18 spec/unit/util/xendomains_spec.rb
facter-1.6.18.rc1 spec/unit/util/xendomains_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/util/xendomains_spec.rb
facter-1.6.17 spec/unit/util/xendomains_spec.rb