Skip to content

Commit 664a75a

Browse files
committed
Test coverage for adding multiple paths to watcher
1 parent f0d2d65 commit 664a75a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/spring/test/watcher_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ def assert_not_stale
163163
assert watcher.files.empty?
164164
end
165165

166+
test "add multiple files" do
167+
File.write("#{dir}/foo", "foo")
168+
File.write("#{dir}/bar", "bar")
169+
watcher.add "foo", "bar"
170+
assert_equal ["#{dir}/foo", "#{dir}/bar"], watcher.files.to_a
171+
end
172+
173+
test "add files as nested array" do
174+
File.write("#{dir}/foo", "foo")
175+
watcher.add [["foo"]]
176+
assert_equal ["#{dir}/foo"], watcher.files.to_a
177+
end
178+
166179
test "add symlink" do
167180
File.write("#{dir}/bar", "bar")
168181
File.symlink("#{dir}/bar", "#{dir}/foo")

0 commit comments

Comments
 (0)