Sha256: 8fffbcfdbf10dd2e995044bb92c8063859a5592758a89543807b0278aa5aed64

Contents?: true

Size: 761 Bytes

Versions: 26

Compression:

Stored size: 761 Bytes

Contents

# @!method have_output_on_stdout
#   This matchers checks if <command> has created output on stdout
#
#   @return [TrueClass, FalseClass] The result
#
#     false:
#     * if command has not created output on stdout
#     true:
#     * if command created output on stdout
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(last_command_started).to have_output_on_stdout }
#     end
RSpec::Matchers.define :have_output_on_stdout do |expected|
  match do |actual|
    @old_actual = actual

    next false unless @old_actual.respond_to? :stdout

    @old_actual.stop

    @actual = sanitize_text(actual.stdout)

    values_match?(expected, @actual)
  end

  diffable

  description { "have output on stdout: #{description_of expected}" }
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
aruba-0.12.0 lib/aruba/matchers/command/have_output_on_stdout.rb
aruba-0.11.2 lib/aruba/matchers/command/have_output_on_stdout.rb
aruba-0.11.1 lib/aruba/matchers/command/have_output_on_stdout.rb
aruba-0.11.0.pre4 lib/aruba/matchers/command/have_output_on_stdout.rb
aruba-0.11.0.pre3 lib/aruba/matchers/command/have_output_on_stdout.rb
aruba-0.11.0.pre2 lib/aruba/matchers/command/have_output_on_stdout.rb