From 691f7f992b6811b6a4458ae4cb4a73822461c4aa Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Tue, 17 Sep 2024 23:49:14 -0400 Subject: [PATCH] Make spring specs a little more explicit --- spec/dotenv/rails_spec.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/dotenv/rails_spec.rb b/spec/dotenv/rails_spec.rb index ba95eba..59fc678 100644 --- a/spec/dotenv/rails_spec.rb +++ b/spec/dotenv/rails_spec.rb @@ -75,7 +75,7 @@ end it "watches other loaded files with Spring" do - stub_spring + stub_spring(load_watcher: true) application.initialize! path = fixture_path("plain.env") Dotenv.load(path) @@ -101,7 +101,7 @@ subject { application.initialize! } it "watches .env with Spring" do - stub_spring + stub_spring(load_watcher: true) subject expect(Spring.watcher).to include(fixture_path(".env").to_s) end @@ -215,15 +215,15 @@ end def stub_spring(load_watcher: true) - spring = Module.new - - if load_watcher - def spring.watcher - @watcher ||= Set.new - end - - def spring.watch(path) - watcher.add path + spring = Module.new do + if load_watcher + def self.watcher + @watcher ||= Set.new + end + + def self.watch(path) + watcher.add path + end end end