Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ohbarye
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
ohbarye
2y ago
It's very basic content though, here's the slides of my presentation at RubyKaigi 2024. This also includes the PBT gems's explanations. https://speakerdeck.com/ohbarye/unlocking-potential-of-prope... Spe
2.
▲
by
ohbarye
2y ago
I love seeing people suggest clever names I couldn't have thought of.
3.
▲
by
ohbarye
2y ago
Good point. There's already such a project to run PBT based on RBS. I'm also keeping an eye on this. https://github.com/ksss/raap
4.
▲
by
ohbarye
2y ago
Wow, I didn't know about them. Thanks for letting me know!
5.
▲
by
ohbarye
2y ago
Yeah, the easiest way is to generate attributes and instantiate any Rails model like the one below: Pbt.assert do Pbt.property(name: Pbt.printable_string, age: Pbt.integer(min: 0, max: 100)) do |name:, age:| user = User.
6.
▲
by
ohbarye
2y ago
I think there are usually three actions a programmer can take when PBT fails. - Create a test case that doesn't depend on PBT as you suggest. - Fix the production code being tested since its failure is an unexpected bug. - Fix the PBT
7.
▲
by
ohbarye
2y ago
>yes, because you're changing the order in which the random draws are interpreted. But this isn't a problem in practice because you generally aren't changing the generator in the middle of debugging a failure. Correct. The
8.
▲
by
ohbarye
2y ago
I can really empathize. Hope the Ruby ecosystem gets more compatible with Ractor.
9.
▲
by
ohbarye
2y ago
Thank you. In my opinion, PBT should be used in combination with example-based testing. Besides, since example-based testing cases account for the majority of tests, I think it's rare that PBT's execution time is dominant. As for
10.
▲
by
ohbarye
2y ago
Thank you. I hope the gem will make your testing life happier!
11.
▲
by
ohbarye
2y ago
The answer to both questions is yes. This gem doesn't aim to reimplement a testing framework. It can also be considered just an assertion. You can use this alongside any testing framework like RSpec, minitest, and etc.
12.
▲
Show HN: PBT – A property-based testing library for Ruby
(github.com)
196 points
by
ohbarye
2y ago
|
33 comments
13.
▲
by
ohbarye
3y ago
Maybe not only 100 lines of code though, I think of Code Crafters. https://github.com/codecrafters-io/build-your-own-x
14.
▲
by
ohbarye
4y ago
This comment describes well. https://github.com/rails/rails/pull/45553#issuecomment-11795...
15.
▲
Show HN: React Hooks and Context API Example
(github.com)
3 points
by
ohbarye
8y ago
|
0 comments
16.
▲
Show HN: How to find OSS repositories or issues you can contribute
(goofi.now.sh)
4 points
by
ohbarye
8y ago
|
0 comments
17.
▲
Show HN: Slack-bot that makes your team's review smooth
(github.com)
1 points
by
ohbarye
8y ago
|
0 comments
18.
▲
by
ohbarye
8y ago
That's new to me even though I'm Japanese. lol