Skip to content

Compounding doesn't work #24

@uvlad7

Description

@uvlad7

Describe the problem

A brief description of the issue.

README shows an example that doesn't work; the second check is ignored; I believe not possible to combine two checks with and.

Steps to reproduce the problem

# test that fails
expect {
      2 ** 128
    }.to perform_at_least(1000000000000).ips
#  expected block to perform at least 1T i/s, but performed only 2.37M (± 11%) i/s

# now it passes
expect {
      2 ** 128
    }.to perform_under(6).ms and perform_at_least(10000).ips

# because the second one is equivalent to
expect {
      2 ** 128
    }.to(perform_under(6).ms) and perform_at_least(10000).ips

Actual behaviour

Second check is ignored

Expected behaviour

It's probably not possible to compound checks like this, as and is not overloadable; just remove it from README

Describe your environment

  • OS version: Ubuntu 22.04
  • Ruby version: 2.3.8
  • RSpec::Benchmark version: 0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions