@@ -106,15 +106,13 @@ function! RunAllSpecs()
106106  else 
107107    let  l: spec  =  " " 
108108  endif 
109-   call  SetLastSpecCommand (l: spec )
110109  call  RunSpecs (l: spec )
111110endfunction 
112111
113112"  Current File
114113function !  RunCurrentSpecFile ()
115114  if  InSpecFile ()
116115    let  l: spec  =  @% 
117-     call  SetLastSpecCommand (l: spec )
118116    call  RunSpecs (l: spec )
119117  else 
120118    call  RunLastSpec ()
@@ -130,7 +128,6 @@ function! RunNearestSpec()
130128      call  s: GetNearestTest ()
131129      let  l: spec  =  @%  . "  -g '"   . s: nearestTest  . " '" 
132130    end 
133-     call  SetLastSpecCommand (l: spec )
134131    call  RunSpecs (l: spec )
135132  else 
136133    call  RunLastSpec ()
@@ -140,7 +137,7 @@ endfunction
140137"  Last Spec
141138function !  RunLastSpec ()
142139  if  exists (" s:last_spec_command"  )
143-     call   RunSpecs ( s: last_spec_command) 
140+     execute   s: last_spec_command
144141  endif 
145142endfunction 
146143
@@ -151,7 +148,7 @@ endfunction
151148
152149"  Cache Last Spec Command
153150function !  SetLastSpecCommand (spec)
154-   let  s: last_spec_command  =  a: spec
151+   let  s: last_spec_command  =  substitute ( g: spec_command ,  " {spec} " ,  a: spec,  " g " ) 
155152endfunction 
156153
157154"  Spec Runner
@@ -160,7 +157,8 @@ function! RunSpecs(spec)
160157  if  g: spec_command  == ? " " 
161158    echom  " No spec command specified." 
162159  else 
163-     execute  substitute (g: spec_command , " {spec}"  , a: spec , " g"  )
160+     call  SetLastSpecCommand (a: spec )
161+     execute  s: last_spec_command
164162  end 
165163endfunction 
166164
0 commit comments