Phil Pirozhkov

Results 628 comments of Phil Pirozhkov

`context` is a better fit for examples that need specific conditions. `ContextWording` and some cop that would suggest extracting conditional part of the docstring into a context according to [Use...

I had a similar problem [here](https://github.com/rubocop-hq/rubocop-rspec/issues/761), but opted for `aggregate_failures`. Another option would be to reset the counter for nested expectations (but still count them). There's nothing wrong with the...

@danielnc So ```ruby expect(described_instance) .to have_received(:process_response) .with(contain_exactly(record_1, record_2)) ``` doesn't work for you? Argument matchers shouldn't be counted towards the total number of expectations in the example.

I guess this issue boils down to adding a `IgnoreNested` configuration option for `RSpec/MultipleExpectations` cop to skip counting nested expectations, e.g.: ```ruby expect { my_code }.to raise_error(MyErrorType) do |error| expect(error.cause).to...

Should be trivial enough with any number of arguments, check this out https://relishapp.com/rspec/rspec-mocks/v/3-9/docs/setting-constraints/matching-arguments @danielnc

Let's keep it simple - make a pre-release check of the codebase against real-world-rspec. It takes 15-20m on my machine. WDYT @bquorning ?

How to deal with this, if the described class is quoted as [RSpec core team recommends](https://github.com/rubocop-hq/rubocop-rspec/issues/228#issue-185291665) ([also related](https://github.com/rspec/rspec-core/issues/1610#issuecomment-46255261)): ```ruby RSpec.describe 'Foo' do before do allow(Foo).to receive(:bars).and_return([:baz, :qux]) end end ```...

Do you think there are other types like that one? Like symbols, or maybe strings? > `1

I guess the same applies to at least some [other replacements](https://github.com/rubocop-hq/rubocop-rspec/blob/master/lib/rubocop/cop/rspec/capybara/feature_methods.rb#L48), doesn't it? What would you recommend, disable this cop by default?

I'm guilty of separating `before` hooks when they do unrelated things, e.g.: ```ruby before { allow(user).to receive(:delete).and_return(true) } before { user.tags