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