Sha256: 27c779755dd9ede3ce1ae66ead23741ba1bbc5ec9f8c564c2c96410ba95baf33

Contents?: true

Size: 351 Bytes

Versions: 22

Compression:

Stored size: 351 Bytes

Contents

RSpec::Matchers.define :return_stdout do |content|
  match do |command|
    if command.respond_to?(:return_stdout?)
      command.return_stdout?(content)
    else
      ret = backend.run_command(command)
      if content.instance_of?(Regexp)
        ret[:stdout] =~ content
      else
        ret[:stdout].strip == content
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
serverspec-0.4.3 lib/serverspec/matchers/return_stdout.rb
serverspec-0.4.2 lib/serverspec/matchers/return_stdout.rb