Sorc96 / rspec-watcher

Instant feedback for awesome TDD experience with Ruby and RSpec
MIT License
17 stars 2 forks source link

Watch runs twice for default Rails 7 setup #2

Open guicattani opened 5 months ago

guicattani commented 5 months ago

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 commented 5 months ago

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.