Sha256: 94ba78cdb1db0bd3ea158505a2b4eecfde29c7a2c9a6ba755fc0428f71b318f9

Contents?: true

Size: 940 Bytes

Versions: 66

Compression:

Stored size: 940 Bytes

Contents

module Serverspec
  module Type
    class Service < Base
      def enabled?(level=3)
        backend.check_enabled(@name, level)
      end

      def running?(under)
        if under
          check_method = "check_running_under_#{under}".to_sym

          unless commands.respond_to?(check_method)
            raise ArgumentError.new("`be_running` matcher doesn't support #{under}")
          end

          backend.send(check_method, @name)
        else
          backend.check_running(@name)
        end
      end

      def monitored_by?(monitor)
        check_method = "check_monitored_by_#{monitor}".to_sym
        unless monitor && commands.respond_to?(check_method)
          raise ArgumentError.new("`be_monitored_by` matcher doesn't support #{monitor}")
        end

        backend.send(check_method, @name)
      end

      def has_property?(property)
        backend.check_svcprops(@name, property)
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
serverspec-0.9.5 lib/serverspec/type/service.rb
serverspec-0.9.4 lib/serverspec/type/service.rb
serverspec-0.9.3 lib/serverspec/type/service.rb
serverspec-0.9.2 lib/serverspec/type/service.rb
serverspec-0.9.1 lib/serverspec/type/service.rb
serverspec-0.9.0 lib/serverspec/type/service.rb
serverspec-0.8.1 lib/serverspec/type/service.rb
serverspec-0.8.0 lib/serverspec/type/service.rb
serverspec-0.7.13 lib/serverspec/type/service.rb
serverspec-0.7.12 lib/serverspec/type/service.rb
serverspec-0.7.11 lib/serverspec/type/service.rb
serverspec-0.7.10 lib/serverspec/type/service.rb
serverspec-0.7.9 lib/serverspec/type/service.rb
serverspec-0.7.8 lib/serverspec/type/service.rb
serverspec-0.7.7 lib/serverspec/type/service.rb
serverspec-0.7.6 lib/serverspec/type/service.rb
serverspec-0.7.5 lib/serverspec/type/service.rb
serverspec-0.7.4 lib/serverspec/type/service.rb
serverspec-0.7.3 lib/serverspec/type/service.rb
serverspec-0.7.2 lib/serverspec/type/service.rb