Skip to content

Commit

Permalink
Make spring specs a little more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Sep 18, 2024
1 parent f75ff89 commit 691f7f9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions spec/dotenv/rails_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 691f7f9

Please sign in to comment.