This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-10
lines changed
Expand file tree Collapse file tree 2 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,4 @@ spec/test_app
3333Gemfile.lock
3434
3535/gemfiles /* .lock
36+ /tmp
Original file line number Diff line number Diff line change 11require 'bundler'
22Bundler . require
33
4- require "opal- rspec"
4+ require "opal/ rspec"
55require "opal-jquery"
6- #require "react/source"
76
8- Opal . append_path File . expand_path ( '../spec' , __FILE__ )
7+ begin
8+ require "react-rails"
9+ rescue NameError
10+ end
911
10- run Opal ::Server . new { |s |
11- s . main = 'opal/rspec/sprockets_runner'
12- s . append_path 'spec'
13- #s.append_path File.dirname(::React::Source.bundled_path_for("react-with-addons.js"))
14- s . debug = true
15- s . index_path = 'spec/index.html.erb'
16- }
12+ if Opal ::RSpec . const_defined? ( "SprocketsEnvironment" )
13+ sprockets_env = Opal ::RSpec ::SprocketsEnvironment . new
14+ sprockets_env . cache = Sprockets ::Cache ::FileStore . new ( "tmp" )
15+ sprockets_env . add_spec_paths_to_sprockets
16+ run Opal ::Server . new ( sprockets : sprockets_env ) { |s |
17+ s . main = 'opal/rspec/sprockets_runner'
18+ s . append_path React ::Rails ::AssetVariant . new ( addons : true ) . react_directory
19+ s . debug = false
20+ s . append_path 'spec/vendor'
21+ s . index_path = 'spec/index.html.erb'
22+ }
23+ else
24+ run Opal ::Server . new { |s |
25+ s . main = 'opal/rspec/sprockets_runner'
26+ s . append_path React ::Rails ::AssetVariant . new ( addons : true ) . react_directory
27+ s . append_path 'spec'
28+ s . append_path 'spec/vendor'
29+ s . debug = false
30+ s . index_path = 'spec/index.html.erb'
31+ }
32+ end
You can’t perform that action at this time.
0 commit comments