Thijs de Vries

Results 25 comments of Thijs de Vries

I think you meant `unless` instead of `if` but essentially, find the first ancestor block which is not an iterator or conditional block and if it is part of example...

Here is an example of what I got so far: ```ruby # frozen_string_literal: true module RuboCop module Cop module RSpec class PersistenceCalledOutsideExample < Base MSG = 'Persistence called outside of...

I'm temporarily changing this PR to a draft while I make these change. I'll ping you when I'm ready for re-review.

@pirj I've made the following changes: * Only flag errors inside `describe` blocks. * Allow configuration of `AllowedBlockNames` as a workaround for those who use custom rspec blocks. * Flag...

So in terms of things we want to change: 1. Reduce amount of disallowed methods: Reduce methods to: `create, build, create_list, build_list` for FactoryBot `save[!], update[!], create[!], create_or_find_by[!], find_or_create_by[!], first_or_create[!]`...

Hey @pirj I've done 1 & 3 as well as removing `AllowedRecievers`. I was also able to get rid of `ForbiddenMethodsWithoutArguments` since none of those methods were included in the...

I get the feeling this should possibly be two rules: 1. No local variables outside before/it blocks. 2. No singleton method calls outside before/it blocks (with some configuration for allowed...

I've always done the klass thing as a `let` statement. Perhaps a bit inefficient since it gets defined every test example. Is that the reason you would prefer local variable...

@pirj I think I'm going to punt on "direct calls to create/build, since it's quite popular to config.include FactoryBot::Syntax::Methods". The reason why is if you use these methods outside of...

@pirj put up a PR, I'm getting the following failure in CI: https://app.circleci.com/pipelines/github/rubocop-hq/rubocop-rspec/460/workflows/bea51799-651f-4806-8016-12f297c9112f/jobs/16335, it looks un-related to my changes though. Any thoughts?