spec/spec_helper.rb in opal-0.9.0.beta2 vs spec/spec_helper.rb in opal-0.9.0.rc1
- old
+ new
@@ -18,33 +18,21 @@
end
def eval_js(javascript)
`eval(javascript)`
end
-
- def at_exit(&block)
- $AT_EXIT_CALLBACKS ||= []
- $AT_EXIT_CALLBACKS << block
- end
end
-is_node = `typeof(process) == 'object' && !!process.versions.node`
-is_browser = `(typeof(window) !== 'undefined')`
-is_phantom = is_browser && `!!window.OPAL_SPEC_PHANTOM`
+require 'mspec/utils/script' # Needed by DottedFormatter
+formatter_class = DottedFormatter
-case
-when is_node
- formatter_class = NodeJSFormatter
-when is_phantom
- require 'phantomjs'
- formatter_class = PhantomFormatter
-else
- formatter_class = BrowserFormatter
-end
-
-# Uncomment the following to see example titles when they're executed.
-# (useful to relate debug output to the example that generated it)
+require 'mspec/opal/formatters'
+# Uncomment one of the following to use a different formatter:
#
-#formatter_class = PhantomDebugFormatter
+#formatter_class = BrowserFormatter
+#formatter_class = NodeJSFormatter
+#formatter_class = NodeJSDocFormatter
+#formatter_class = PhantomFormatter
+#formatter_class = PhantomDocFormatter
# As soon as this file loads, tell the runner the specs are starting
OSpecRunner.main(formatter_class).will_start