@@ -106,15 +106,13 @@ function! RunAllSpecs()
106
106
else
107
107
let l: spec = " "
108
108
endif
109
- call SetLastSpecCommand (l: spec )
110
109
call RunSpecs (l: spec )
111
110
endfunction
112
111
113
112
" Current File
114
113
function ! RunCurrentSpecFile ()
115
114
if InSpecFile ()
116
115
let l: spec = @%
117
- call SetLastSpecCommand (l: spec )
118
116
call RunSpecs (l: spec )
119
117
else
120
118
call RunLastSpec ()
@@ -130,7 +128,6 @@ function! RunNearestSpec()
130
128
call s: GetNearestTest ()
131
129
let l: spec = @% . " -g '" . s: nearestTest . " '"
132
130
end
133
- call SetLastSpecCommand (l: spec )
134
131
call RunSpecs (l: spec )
135
132
else
136
133
call RunLastSpec ()
@@ -140,7 +137,7 @@ endfunction
140
137
" Last Spec
141
138
function ! RunLastSpec ()
142
139
if exists (" s:last_spec_command" )
143
- call RunSpecs ( s: last_spec_command)
140
+ execute s: last_spec_command
144
141
endif
145
142
endfunction
146
143
@@ -151,7 +148,7 @@ endfunction
151
148
152
149
" Cache Last Spec Command
153
150
function ! SetLastSpecCommand (spec)
154
- let s: last_spec_command = a: spec
151
+ let s: last_spec_command = substitute ( g: spec_command , " {spec} " , a: spec, " g " )
155
152
endfunction
156
153
157
154
" Spec Runner
@@ -160,7 +157,8 @@ function! RunSpecs(spec)
160
157
if g: spec_command == ? " "
161
158
echom " No spec command specified."
162
159
else
163
- execute substitute (g: spec_command , " {spec}" , a: spec , " g" )
160
+ call SetLastSpecCommand (a: spec )
161
+ execute s: last_spec_command
164
162
end
165
163
endfunction
166
164
0 commit comments