Sha256: 620629329f02a8323b03934af8f01275ef0fa6cdbd2d521bbed4839ccd5b6ad7
Contents?: true
Size: 834 Bytes
Versions: 12
Compression:
Stored size: 834 Bytes
Contents
# encoding: utf-8 require 'utils/command_wrapper' require 'resources/command' module Inspec::Resources class Bash < Cmd name 'bash' supports platform: 'unix' desc 'Run a command or script in BASH.' example <<~EXAMPLE describe bash('ls -al /') do its('stdout') { should match /bin/ } its('stderr') { should eq '' } its('exit_status') { should eq 0 } end # Specify the path of the executable: bash('...', path: '/bin/bash') # Specify arguments (defaults to -c) bash('...', args: '-x -c') EXAMPLE def initialize(command, options = {}) @raw_command = command options[:shell] = 'bash' if options.is_a?(Hash) super(CommandWrapper.wrap(command, options)) end def to_s "Bash command #{@raw_command}" end end end
Version data entries
12 entries across 12 versions & 2 rubygems