1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00
therubyrhino/spec/spec_helper.rb

40 lines
682 B
Ruby
Raw Normal View History

2009-09-24 20:06:31 -04:00
require 'rhino'
2012-04-13 14:32:31 -04:00
2013-03-11 03:46:18 -04:00
begin
require 'mocha/api'
rescue LoadError
require 'mocha'
end
2012-04-13 14:32:31 -04:00
require 'redjs'
module RedJS
Context = Rhino::Context
Error = Rhino::JSError
end
module Rhino
module SpecHelpers
def context_factory
@context_factory ||= Rhino::JS::ContextFactory.new
end
def context
@context || context_factory.call { |ctx| @context = ctx }
@context
end
def scope
context.initStandardObjects(nil, false)
end
end
end
RSpec.configure do |config|
config.filter_run_excluding :compat => /(0.5.0)|(0.6.0)/ # RedJS
config.include Rhino::SpecHelpers
2014-02-20 14:38:45 -05:00
config.deprecation_stream = 'spec/deprecations.log'
end