Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compounding doesn't work #24

Open
uvlad7 opened this issue Oct 14, 2024 · 0 comments
Open

Compounding doesn't work #24

uvlad7 opened this issue Oct 14, 2024 · 0 comments
Labels

Comments

@uvlad7
Copy link

uvlad7 commented Oct 14, 2024

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
@uvlad7 uvlad7 added the bug label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant