Sha256: a90cf658ca6087a7862563c94339db8afba20bc73c3118988b5caf47f6e97671

Contents?: true

Size: 1022 Bytes

Versions: 6

Compression:

Stored size: 1022 Bytes

Contents

require 'opal'
require 'set'
require 'opal-parser'
require 'mspec'
require 'mspec/version'
require 'support/mspec_rspec_adapter'
require 'mspec/opal/runner'

require 'math'
require 'encoding'

ENV['MSPEC_RUNNER'] = true

module Kernel
  def opal_parse(str, file='(string)')
    Opal::Parser.new.parse str, file
  end

  def eval_js(javascript)
    `eval(javascript)`
  end

  def at_exit(&block)
    $AT_EXIT_CALLBACKS ||= []
    $AT_EXIT_CALLBACKS << block
  end
end

case
when defined?(NodeJS)
  formatter_class = NodeJSFormatter
when `(typeof(window) !== 'undefined')`
  if `!!window.OPAL_SPEC_PHANTOM`
    require 'phantomjs'
    formatter_class = PhantomFormatter
  else
    formatter_class = BrowserFormatter
  end
end

# Uncomment the following to see example titles when they're executed.
# (useful to relate debug output to the example that generated it)
#
#formatter_class = PhantomDebugFormatter

# As soon as this file loads, tell the runner the specs are starting
OSpecRunner.main(formatter_class).will_start

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-0.7.2 spec/spec_helper.rb
opal-0.7.1 spec/spec_helper.rb
opal-0.7.0 spec/spec_helper.rb
opal-0.7.0.rc1 spec/spec_helper.rb
opal-0.7.0.beta3 spec/spec_helper.rb
opal-0.7.0.beta2 spec/spec_helper.rb