Earlier quoted context omitted.
Ruby just simply isn’t the glue language winner because of the heavy emphasis on rails. From a systems perspective, I had to switch to python because it has pyroute2, which supports rtnl, devlink, ethtool and more. I would have thought ruby had a full-fledged netlink library right now considering the stability of chef and puppet. But all I could find was this from 8 years ago: https://github.com/BytemarkHosting/netli…
> I wish it was all ruby Why do you not wish it was all Python?
Show HN: PBT – A property-based testing library for Ruby
31–37 of 37 posts
Re: Show HN: PBT – A property-based testing library for Ruby
#32Re: Show HN: PBT – A property-based testing library for Ruby
#33Interesting! I wonder how this could be applied to a Rails project (since that's what ruby is most used for). For example how would it know to test a wide selection of possible values for different variables if they're not explicitly set up?
I imagine it wouldn't be too hard to build up your own data generators for Rails models (or other entities).
Pbt.assert do
Pbt.property(name: Pbt.printable_string, age: Pbt.integer(min: 0, max: 100)) do |name:, age:|
user = User.new(name: name, age: age)
# write your test here
end
endRe: Show HN: PBT – A property-based testing library for Ruby
#34Great work, looks really clean! Check out Minithesis [1] and the paper explaining internal shrinking [2]. It will strongly improve your library's shrinking capabilities and prevent users from having to write their own shrinkers for custom objects in most cases. [1] https://github.com/DRMacIver/minithesis [2] https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.E...
Re: Show HN: PBT – A property-based testing library for Ruby
#35Lovely stuff, thank you. It would be cool if we could eventually make use of RBS or inline Sorbet or something better than both to get the types for property testing for free.
Re: Show HN: PBT – A property-based testing library for Ruby
#36They missed the opportunity to name this library 'Double Shot'.
Re: Show HN: PBT – A property-based testing library for Ruby
#37Can anyone recommend an introduction to PBT for someone who knows nothing about it? Edited to add: D'oh! There's an explanation in the linked repo.
https://speakerdeck.com/ohbarye/unlocking-potential-of-prope...
Speaking of my personal story, I used the fast-check documentation and Fred Herbert's book (their links are in the README) to study.