Sha256: ec122e97d9eab6a42102ea3a0593e25534d4a50de997b4661994ed224497b335

Contents?: true

Size: 554 Bytes

Versions: 29

Compression:

Stored size: 554 Bytes

Contents

require 'singleton'

module Serverspec
  module Backend
    class Base
      include Singleton

      def set_commands(c)
        @commands = c
      end

      def set_example(e)
        @example = e
      end

      def commands
        @commands
      end
      
      def check_zero(cmd, *args)
        ret = run_command(commands.send(cmd, *args))
        ret[:exit_status] == 0
      end

      # Default action is to call check_zero with args
      def method_missing(meth, *args, &block)
        check_zero(meth, *args)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
serverspec-0.11.5 lib/serverspec/backend/base.rb
serverspec-0.11.4 lib/serverspec/backend/base.rb
serverspec-0.11.3 lib/serverspec/backend/base.rb
serverspec-0.11.2 lib/serverspec/backend/base.rb
serverspec-0.11.1 lib/serverspec/backend/base.rb
serverspec-0.11.0 lib/serverspec/backend/base.rb
serverspec-0.10.13 lib/serverspec/backend/base.rb
serverspec-0.10.12 lib/serverspec/backend/base.rb
serverspec-0.10.11 lib/serverspec/backend/base.rb
serverspec-0.10.10 lib/serverspec/backend/base.rb
serverspec-0.10.9 lib/serverspec/backend/base.rb
serverspec-0.10.8 lib/serverspec/backend/base.rb
serverspec-0.10.7 lib/serverspec/backend/base.rb
serverspec-0.10.6 lib/serverspec/backend/base.rb
serverspec-0.10.5 lib/serverspec/backend/base.rb
serverspec-0.10.4 lib/serverspec/backend/base.rb
serverspec-0.10.3 lib/serverspec/backend/base.rb
serverspec-0.10.2 lib/serverspec/backend/base.rb
serverspec-0.10.1 lib/serverspec/backend/base.rb
serverspec-0.10.0 lib/serverspec/backend/base.rb