Sha256: f6eb2de13767221107c95a952337af0303d52a7ed54aec38d961e0b06903842e
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
require 'opal' require 'opal-sprockets' require 'opal/rspec/version' require 'opal/rspec/runner' require 'opal/rspec/configuration_parser' # Just register our opal code path with opal build tools Opal.append_path File.expand_path('../../../lib-opal', __FILE__) Opal.append_path File.expand_path('../../../stubs', __FILE__) # Catch our git submodule included directories %w{rspec rspec-core rspec-expectations rspec-mocks rspec-support diff-lcs}.each do |gem_name| Opal.append_path File.expand_path("../../../#{gem_name}/upstream/lib", __FILE__) end # Since we have better specs than before (and a script to deal with this), ignoring Opal::Config.dynamic_require_severity = :ignore module Opal module RSpec autoload :ProjectInitializer, 'opal/rspec/project_initializer' def self.convert_spec_opts(opts) opts ||= ENV['SPEC_OPTS'] || {} unless opts.is_a? Hash opts = Shellwords.split(opts) if opts.is_a? String opts = Opal::RSpec::Core::Parser.parse(opts || []) end opts end def self.spec_opts_code(spec_opts) spec_opts = convert_spec_opts(spec_opts) code = [] code << '# await: true' # New API - passthru options spec_opts[:files_or_directories_to_run] ||= [] code << "$rspec_opts = #{spec_opts.inspect}" code << "$0 = 'opal-rspec'" code << '::RSpec::Core::Runner.invoke.__await__' code.join("\n") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
opal-rspec-1.1.0.alpha1 | lib/opal/rspec.rb |