Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch runs twice for default Rails 7 setup #2

Open
guicattani opened this issue May 2, 2024 · 1 comment
Open

Watch runs twice for default Rails 7 setup #2

guicattani opened this issue May 2, 2024 · 1 comment

Comments

@guicattani
Copy link

Hey!

Thanks a lot for the gem, it's super useful and works with latest Ruby and Rails versions! 😁

Somehow rspec-watcher runs rspec twice everytime something changes.
I tried seeing if it was a duplicate rule on config/initializers/rspec_watcher.rb but it wasn't.

So I created a new rails 7.1.3.2 with ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux] application by running.

rails new testme -d postgresql --api --minimal
bundle add rspec-rails --group "test"
rails g rspec:install

And creating a new test with sleep(1) you can see this very clearly.
rspecwatcher

Hopefully I can help once I get more acquainted with the gem.
Let me know if you need any more info :)

@Sorc96
Copy link
Owner

Sorc96 commented May 2, 2024

Hi,
thanks for trying out my gem! I haven't been able to immediately replicate this using the same versions of Ruby and Rails. Could you try adding some form of logging into the watch blocks in the initializer? Hopefully that could help determine why rspec gets triggered twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants