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

[Enhancement] Make Typhoeus call check more natural to read #66

Open
ghost opened this issue Dec 20, 2022 · 0 comments
Open

[Enhancement] Make Typhoeus call check more natural to read #66

ghost opened this issue Dec 20, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2022

Rspec tests usually follow a human-readable schema that's almost an English sentence.

We currently check whether a Typhoeus stub was called with expect(stub.times_called).to eq(1). Side note: times_called uses Typhoeus private data.

Rspec, at least for yield_control, has expect { ... }.to yield_control.twice and similar tests. Following the same design as yield_control we could implement the following have_been_called matcher:

expect(stub).to have_been_called
expect(stub).to have_been_called.once
expect(stub).to have_been_called.exactly(k).times
expect(stub).to have_been_called.at_most(k).times
expect(stub).to have_been_called.at_least(k).times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants