Sha256: a318ae74b906b508d8f2a640a42c0c45225525c6be9ad651cf14c793583a4ff6

Contents?: true

Size: 491 Bytes

Versions: 34

Compression:

Stored size: 491 Bytes

Contents

module Serverspec::Type
  class Base
    
    attr_reader :name
    
    def initialize(name=nil)
      @name   = name
      @runner = Specinfra::Runner
    end

    def to_s
      type = self.class.name.split(':')[-1]
      type.gsub!(/([a-z\d])([A-Z])/, '\1 \2')
      type.capitalize!
      %Q!#{type} "#{@name}"!
    end

    def inspect
      if defined?(PowerAssert)
        @inspection
      else
        to_s
      end
    end

    def to_ary
      to_s.split(" ")
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
serverspec-ruby19-2.24.3 lib/serverspec/type/base.rb
serverspec-2.25.0 lib/serverspec/type/base.rb
serverspec-2.24.3 lib/serverspec/type/base.rb
serverspec-2.24.2 lib/serverspec/type/base.rb
serverspec-2.24.1 lib/serverspec/type/base.rb
serverspec-2.24.0 lib/serverspec/type/base.rb
serverspec-2.23.1 lib/serverspec/type/base.rb
serverspec-2.23.0 lib/serverspec/type/base.rb
serverspec-2.22.0 lib/serverspec/type/base.rb
serverspec-2.21.1 lib/serverspec/type/base.rb
serverspec-2.21.0 lib/serverspec/type/base.rb
serverspec-2.20.0 lib/serverspec/type/base.rb
serverspec-2.19.0 lib/serverspec/type/base.rb
serverspec-2.18.0 lib/serverspec/type/base.rb
serverspec-2.17.1 lib/serverspec/type/base.rb
serverspec-2.17.0 lib/serverspec/type/base.rb
serverspec-2.16.0 lib/serverspec/type/base.rb
serverspec-2.15.0 lib/serverspec/type/base.rb
serverspec-2.14.1 lib/serverspec/type/base.rb
serverspec-2.14.0 lib/serverspec/type/base.rb