Sha256: 95e2f8ed6ad0819be2b4ededc2a85d79cd43b3f85ef3a454e7d5f60a6054fd77

Contents?: true

Size: 761 Bytes

Versions: 26

Compression:

Stored size: 761 Bytes

Contents

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

    next false unless @old_actual.respond_to? :stderr

    @old_actual.stop

    @actual = sanitize_text(actual.stderr)

    values_match?(expected, @actual)
  end

  diffable

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

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
aruba-0.14.14 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.13 lib/aruba/matchers/command/have_output_on_stderr.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/aruba-0.14.12/lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.12 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.11 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.10 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.9 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.8 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.7 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.6 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.5 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.4 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.3 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-1.0.0.pre.alpha.2 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-1.0.0.pre.alpha.1 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-win-fix-0.14.2 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.2 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.1 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.14.0 lib/aruba/matchers/command/have_output_on_stderr.rb
aruba-0.13.0 lib/aruba/matchers/command/have_output_on_stderr.rb