Sha256: cb4e180fbb134b10c7e5adbcc3c6d44e6e137d870fb84af7bf60c921f46c7dbb

Contents?: true

Size: 1.49 KB

Versions: 100

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

test_title = 'Integration Tests for Puppet::Type::Service::Provider::Windows'

describe test_title, '(integration)', :if => Puppet::Util::Platform.windows? do
  let(:provider_class) { Puppet::Type.type(:service).provider(:windows) }

  require 'puppet/util/windows'

  before :each do
    allow(Puppet::Type.type(:service)).to receive(:defaultprovider).and_return(provider_class)
  end

  context 'should return valid values when querying a service that does not exist' do
    let(:service) do
      Puppet::Type.type(:service).new(:name => 'foobarservice1234')
    end

    it "with :false when asked if enabled" do
      expect(service.provider.enabled?).to eql(:false)
    end

    it "with :stopped when asked about status" do
      expect(service.provider.status).to eql(:stopped)
    end
  end

  context 'should return valid values when querying a service that does exist' do
    let(:service) do
      # This service should be ubiquitous across all supported Windows platforms
      Puppet::Type.type(:service).new(:name => 'lmhosts')
    end

    it "with a valid enabled? value when asked if enabled" do
      expect([:true, :false, :manual]).to include(service.provider.enabled?)
    end

    it "with a valid status when asked about status" do
      expect([
        :running,
        :'continue pending',
        :'pause pending',
        :paused,
        :running,
        :'start pending',
        :'stop pending',
        :stopped]).to include(service.provider.status)
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
puppet-6.17.0 spec/integration/provider/service/windows_spec.rb
puppet-6.17.0-x86-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.17.0-x64-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.17.0-universal-darwin spec/integration/provider/service/windows_spec.rb
puppet-6.16.0 spec/integration/provider/service/windows_spec.rb
puppet-6.16.0-x86-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.16.0-x64-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.16.0-universal-darwin spec/integration/provider/service/windows_spec.rb
puppet-6.15.0 spec/integration/provider/service/windows_spec.rb
puppet-6.15.0-x86-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.15.0-x64-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.15.0-universal-darwin spec/integration/provider/service/windows_spec.rb
puppet-6.14.0 spec/integration/provider/service/windows_spec.rb
puppet-6.14.0-x86-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.14.0-x64-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.14.0-universal-darwin spec/integration/provider/service/windows_spec.rb
puppet-6.13.0 spec/integration/provider/service/windows_spec.rb
puppet-6.13.0-x86-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.13.0-x64-mingw32 spec/integration/provider/service/windows_spec.rb
puppet-6.13.0-universal-darwin spec/integration/provider/service/windows_spec.rb