Sha256: b10ea9720ca57e7c7596d2c0dc129510330749a23b88ed0ccd9565f4f07683e7

Contents?: true

Size: 1.63 KB

Versions: 147

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

RSpec.describe Specinfra::Command::Windows::Base::Service do
  before :all do
    property[:os] = nil
    set :os, :family => 'windows'
  end
  
  let(:service_name) { "Power" }
    let(:property_map) {{"StartName"=>"Local System","State"=>"Running","StartMode"=>"Auto"}}
    describe "#check_service_is_running" do
        it "" do
            command = get_command(:check_service_is_running, service_name)
            expect(command.script).to eq("(FindService -name 'Power').State -eq 'Running'")
        end
    end
    describe "#check_service_is_enabled" do
        it "" do
            command = get_command(:check_service_is_enabled, service_name)
            expect(command.script).to eq ("(FindService -name 'Power').StartMode -eq 'Auto'")
        end
    end
    describe "#has_property" do
        it "includes (FindService -name 'Power').StartName -eq 'Local System" do
            command = get_command(:check_service_has_property, service_name,property_map)
            expect(command.script).to include ("(FindService -name 'Power').StartName -eq 'Local System'")
        end
        it "includes (FindService -name 'Power').State -eq 'Running" do
            command = get_command(:check_service_has_property, service_name,property_map)
            expect(command.script).to include ("(FindService -name 'Power').State -eq 'Running'")
        end
        it "includes (FindService -name 'Power').StartMode -eq 'Auto" do
            command = get_command(:check_service_has_property, service_name,property_map)
            expect(command.script).to include ("(FindService -name 'Power').StartMode -eq 'Auto'")
        end
    end
end

Version data entries

147 entries across 147 versions & 1 rubygems

Version Path
specinfra-2.82.5 spec/command/windows/service_spec.rb
specinfra-2.82.4 spec/command/windows/service_spec.rb
specinfra-2.82.3 spec/command/windows/service_spec.rb
specinfra-2.82.2 spec/command/windows/service_spec.rb
specinfra-2.82.1 spec/command/windows/service_spec.rb
specinfra-2.82.0 spec/command/windows/service_spec.rb
specinfra-2.81.0 spec/command/windows/service_spec.rb
specinfra-2.80.0 spec/command/windows/service_spec.rb
specinfra-2.79.0 spec/command/windows/service_spec.rb
specinfra-2.78.2 spec/command/windows/service_spec.rb
specinfra-2.78.1 spec/command/windows/service_spec.rb
specinfra-2.78.0 spec/command/windows/service_spec.rb
specinfra-2.77.3 spec/command/windows/service_spec.rb
specinfra-2.77.2 spec/command/windows/service_spec.rb
specinfra-2.77.1 spec/command/windows/service_spec.rb
specinfra-2.77.0 spec/command/windows/service_spec.rb
specinfra-2.76.9 spec/command/windows/service_spec.rb
specinfra-2.76.8 spec/command/windows/service_spec.rb
specinfra-2.76.7 spec/command/windows/service_spec.rb
specinfra-2.76.6 spec/command/windows/service_spec.rb