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.91.0 spec/command/windows/service_spec.rb
specinfra-2.90.1 spec/command/windows/service_spec.rb
specinfra-2.90.0 spec/command/windows/service_spec.rb
specinfra-2.89.0 spec/command/windows/service_spec.rb
specinfra-2.88.2 spec/command/windows/service_spec.rb
specinfra-2.88.1 spec/command/windows/service_spec.rb
specinfra-2.88.0 spec/command/windows/service_spec.rb
specinfra-2.87.2 spec/command/windows/service_spec.rb
specinfra-2.87.1 spec/command/windows/service_spec.rb
specinfra-2.87.0 spec/command/windows/service_spec.rb
specinfra-2.86.0 spec/command/windows/service_spec.rb
specinfra-2.85.1 spec/command/windows/service_spec.rb
specinfra-2.85.0 spec/command/windows/service_spec.rb
specinfra-2.84.1 spec/command/windows/service_spec.rb
specinfra-2.84.0 spec/command/windows/service_spec.rb
specinfra-2.83.4 spec/command/windows/service_spec.rb
specinfra-2.83.3 spec/command/windows/service_spec.rb
specinfra-2.83.2 spec/command/windows/service_spec.rb
specinfra-2.83.1 spec/command/windows/service_spec.rb
specinfra-2.83.0 spec/command/windows/service_spec.rb