Class: NodeJSFormatter
Instance Method Summary
collapse
#before, #enter, #exception, #exception?, #failure?, #finish, #initialize, #register, #start
Instance Method Details
#after(state) ⇒ Object
161
162
163
164
|
# File 'opal/lib/mspec/opal/runner.rb', line 161
def after(state)
super
print_example(state)
end
|
#finish_with_code(code) ⇒ Object
174
175
176
|
# File 'opal/lib/mspec/opal/runner.rb', line 174
def finish_with_code(code)
`global.OPAL_SPEC_CODE = code;`
end
|
#green(str) ⇒ Object
149
150
151
|
# File 'opal/lib/mspec/opal/runner.rb', line 149
def green(str)
`process.stdout.write("\033[32m"+#{str}+"\033[0m")`
end
|
157
158
159
|
# File 'opal/lib/mspec/opal/runner.rb', line 157
def log(str)
puts str
end
|
#print_example(state) ⇒ Object
166
167
168
169
170
171
172
|
# File 'opal/lib/mspec/opal/runner.rb', line 166
def print_example(state)
unless exception?
green('.')
else
red(failure? ? 'F' : 'E')
end
end
|
153
154
155
|
# File 'opal/lib/mspec/opal/runner.rb', line 153
def red(str)
`process.stdout.write("\033[31m"+#{str}+"\033[0m")`
end
|