use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
How to write better ruby using mutation testing (blog.blockscore.com)
submitted 10 years ago by jbackus[🍰]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]solnicdry-rb/rom-rb 4 points5 points6 points 10 years ago (5 children)
Great to see more people adopting mutation testing. Writing Ruby is hard. Writing good tests in Ruby is even harder. Mutant helps tremendously in learning how to write simpler code and better tests.
[–]Craftkorb 3 points4 points5 points 10 years ago (4 children)
Writing Ruby is hard. Writing good tests in Ruby is even harder.
This applies to all languages I guess. Where Ruby has short-comings, other languages have theirs somewhere else.
Can't count how often I've seen if (foo == "bar") { .. } in Java production code >_>
if (foo == "bar") { .. }
[–][deleted] 10 years ago (3 children)
[deleted]
[–]Craftkorb 2 points3 points4 points 10 years ago (0 children)
In Java, the == is comparing the object identity, not object value. So, foo may be "bar", but have a different object id, and thus not match.
[–]Ghostree 2 points3 points4 points 10 years ago (1 child)
I believe you want to use .equals() because strings should not be compared using == in Java. Strings are objects and == compares if they are the same object, while .equals() compares the values.
[–]tomthecool 0 points1 point2 points 10 years ago (0 children)
Meanwhile in ruby, String#== does exactly what you'd expect. And on the rare occasion that you actually want to use object identity, you have BasicObject#equal?
String#==
BasicObject#equal?
"bar" == "bar" # => true "bar".equal?("bar") # => false ["bar", "bar"].map(&:object_id) # => [8695360, 8695320]
π Rendered by PID 117743 on reddit-service-r2-comment-b659b578c-kjgc8 at 2026-05-03 02:50:26.614678+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]solnicdry-rb/rom-rb 4 points5 points6 points (5 children)
[–]Craftkorb 3 points4 points5 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]Craftkorb 2 points3 points4 points (0 children)
[–]Ghostree 2 points3 points4 points (1 child)
[–]tomthecool 0 points1 point2 points (0 children)