Sha256: cb9fd7a1739c10c6971e0a4f82d9cc71fe2dd25126f886c45667281da6f23fb6

Contents?: true

Size: 668 Bytes

Versions: 34

Compression:

Stored size: 668 Bytes

Contents

# @!method have_output_size(output)
#   This matchers checks if output has size.
#
#   @param [String] output
#     The content which should be checked
#
#   @return [TrueClass, FalseClass] The result
#
#     false:
#     * if output does not have size
#     true:
#     * if output has size
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(file1).to have_output_size(256) }
#     end
RSpec::Matchers.define :have_output_size do |expected|
  match do |actual|
    next false unless actual.respond_to? :size

    @actual = actual.size
    values_match? expected, @actual
  end

  description { "output has size #{description_of expected}" }
end

Version data entries

34 entries across 34 versions & 3 rubygems

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