Sha256: 4f7e69cfd325e2cf6041748ca87d283bc92c3ff7b64443dac108445ff30830b6
Contents?: true
Size: 788 Bytes
Versions: 6
Compression:
Stored size: 788 Bytes
Contents
require 'opal/rspec/rake_task' Opal::RSpec::RakeTask.new('opal:spec' => :environment) do |server| require 'tempfile' asset_paths = Opal.paths + Rails.configuration.assets.paths.to_a tempfile = Tempfile.new(['opal-rspec', '.js.rb']) server.sprockets.clear_paths asset_paths << File.dirname(tempfile.path) server.main = File.basename(tempfile.path, '.js.rb') asset_paths.each { |path| server.append_path path } required_assets = ['opal'] required_assets << 'opal-rspec-runner' asset_paths.each do |path| Dir["#{path}/spec/**_spec.js.{opal,rb}"].each do |spec| spec = spec[path.size+1..-1] # +1 is for the trailing slash required_assets << spec end end required_assets.each { |a| tempfile.puts "require #{a.inspect}" } tempfile.close end
Version data entries
6 entries across 6 versions & 1 rubygems