Class: NodeJSFormatter
- Inherits:
-
BrowserFormatter
- Object
- BrowserFormatter
- NodeJSFormatter
- Defined in:
- opal/lib/mspec/opal/runner.rb
Direct Known Subclasses
Instance Method Summary collapse
- #after(state) ⇒ Object
- #finish_with_code(code) ⇒ Object
- #green(str) ⇒ Object
- #log(str) ⇒ Object
- #print_example(state) ⇒ Object
- #red(str) ⇒ Object
Methods inherited from BrowserFormatter
#before , #enter , #exception , #exception? , #failure? , #finish , #initialize , #register , #start
Constructor Details
This class inherits a constructor from BrowserFormatter
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
#log(str) ⇒ Object
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
#red(str) ⇒ Object
153 154 155
# File 'opal/lib/mspec/opal/runner.rb', line 153 def red(str) `process.stdout.write("033円[31m"+#{str}+"033円[0m")` end