@@ -134,9 +134,8 @@ describe('Capture template', function()
134134 assert .are .same ({ ' * TODO ' }, template :compile ():wait ())
135135 end )
136136 end )
137-
138137 it (' should complete %^g from target file tags only' , function ()
139- local files = helpers .create_agenda_files ({
138+ local fixtures , org_files = helpers .create_agenda_files ({
140139 {
141140 filename = ' target.org' ,
142141 content = {
@@ -158,14 +157,15 @@ describe('Capture template', function()
158157 end , function ()
159158 local template = Template :new ({
160159 template = ' * TODO %^g' ,
161- target = files [' target.org' ],
160+ target = fixtures [' target.org' ],
162161 })
162+ template .files = org_files
163163 assert .are .same ({ ' * TODO :target_headline:' }, template :compile ():wait ())
164164 end )
165165 end )
166166
167167 it (' should complete %^G from all loaded agenda file tags' , function ()
168- helpers .create_agenda_files ({
168+ local _ , org_files = helpers .create_agenda_files ({
169169 {
170170 filename = ' target.org' ,
171171 content = {
@@ -188,6 +188,7 @@ describe('Capture template', function()
188188 local template = Template :new ({
189189 template = ' * TODO %^G' ,
190190 })
191+ template .files = org_files
191192 assert .are .same ({ ' * TODO :target_headline:other_headline:' }, template :compile ():wait ())
192193 end )
193194 end )
0 commit comments