113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
# File 'lib/minispec/api/instance.rb', line 113
def __ms__run_test label
Minispec.tests += 1
__ms__prepare_test
runner = proc do
self.class.before?(label).each {|(l,m,b)| instance_exec(l,m,&b)}
catch :__ms__stop_evaluation do
instance_exec(&self.class.tests[label].last)
end
self.class.after?(label).each {|(l,m,b)| instance_exec(l,m,&b)}
end
if around = self.class.around?(label).last
self.instance_exec(runner, &around.last)
else
runner.call
end
__ms__mocks__validate_expectations
__ms__mocks__restore_originals
@__ms__failures
rescue Exception => e
[e]
ensure
__ms__mocks__reset_variables
end
|