Sha256: f7ef5ce6c7f8f95db6d99aaf17311756ccc2e2af6acf9a0f83e3d9c9cb0c9156

Contents?: true

Size: 690 Bytes

Versions: 16

Compression:

Stored size: 690 Bytes

Contents

# @!method have_output_size(output)
#   This matchers checks if output has size.
#
#   @param [String] output
#     The content which should be checked
#
#   @return [Boolean] 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|
    raise "Expected #{actual} to respond to #size" unless actual.respond_to? :size

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

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

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/matchers/command/have_output_size.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/matchers/command/have_output_size.rb
aruba-2.2.0 lib/aruba/matchers/command/have_output_size.rb
aruba-2.1.0 lib/aruba/matchers/command/have_output_size.rb
aruba-2.0.1 lib/aruba/matchers/command/have_output_size.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/aruba-2.0.0/lib/aruba/matchers/command/have_output_size.rb
aruba-2.0.0 lib/aruba/matchers/command/have_output_size.rb
aruba-1.1.2 lib/aruba/matchers/command/have_output_size.rb
aruba-1.1.1 lib/aruba/matchers/command/have_output_size.rb
aruba-1.1.0 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.4 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.3 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.2 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.1 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.0 lib/aruba/matchers/command/have_output_size.rb
aruba-1.0.0.pre.alpha.5 lib/aruba/matchers/command/have_output_size.rb