Phil Pirozhkov
Phil Pirozhkov
> `be_truthy`/`be_falsey` should be forbidden in a different cop Completely agree.  Splitting cops ☝️ > `be_truthy`/`be_falsey` ... can think of no circumstance where they should be used. If we...
Hold on for a second. What are the `PredicateMatcher` configuration where it tells the prefer `expect(error.nil?).to be(true)` over `expect(error).to be_nil`? Is it the default setting? With the default, which is...
I'm sorry I didn't check properly initially, and it's good that we've researched this. So, from my point of view: 1. The code example `expect(foo).to be(true)` is incorrect 2. For...
I'm working on a pull request (not pushed yet) to address the issues of the `PredicateMatcher`. 1. fixed 2. >> For the code in the description, the cop with default...
>> In general, we recommend you use the loosest matcher that still specifies the behaviour you care about. > Right, I agree with that quote, but only in the context...
> # corrected to > expect(something.is_a?(SomeClass)).to be(true) > > That's also equally bad, for the same reasons as the rest. I'm not sure I understand. Do you think `is_a?` should...
To avoid any ambiguity, I didn't mean testing private methods. I meant private API that is callable but not by regular gem's consumers. E.g. RuboCop's `ConfigLoader` or `ConfigValidator`. I don't...
```diff - expect(ary.size).to be(3) + expect(ary).to have(3).items ``` IIRC, `have` is from [`rspec-collection_matchers`](https://github.com/rspec/rspec-collection_matchers). Out of the box, this works: ```diff - expect(ary.size).to be(3) + expect(ary).to have_attributes(size: 3) ``` but for...
```diff - expect(ary.size).to be(3) - expect(ary[0]).to some_matcher - expect(ary[2]).to some_other_matcher + expect(ary).to match_array [ + some_matcher, + anything, + some_other_matcher, + ] # Note: size checked implicitly ``` This appeals...
Let me start with splitting the spec file into strict and non-strict, it will pave the way to splitting the cop. We can iteratively spawn new cops or extend existing...