Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit b68dac6

Browse files
committed
Migrate test setup to use new ‘react/react-source’
1 parent bbaabab commit b68dac6

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

Rakefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ ENV['REAL_BUNDLE_GEMFILE'] = ENV['BUNDLE_GEMFILE']
99
require 'rspec/core/rake_task'
1010
require 'opal/rspec/rake_task'
1111

12-
begin
13-
require "react-rails"
14-
rescue NameError
15-
end
12+
require 'react/react-source'
1613

1714
RSpec::Core::RakeTask.new('ruby:rspec')
1815

1916
Opal::RSpec::RakeTask.new('opal:rspec') do |s, task|
20-
s.append_path React::Rails::AssetVariant.new(addons: true).react_directory
2117
s.append_path 'spec/vendor'
2218
s.index_path = 'spec/index.html.erb'
2319
task.timeout = 80000 if task

config.ru

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,21 @@ Bundler.require
44
require "opal/rspec"
55
require "opal-jquery"
66

7-
begin
8-
require "react-rails"
9-
rescue NameError
10-
end
7+
require 'react/react-source'
118

129
if Opal::RSpec.const_defined?("SprocketsEnvironment")
1310
sprockets_env = Opal::RSpec::SprocketsEnvironment.new
1411
sprockets_env.cache = Sprockets::Cache::FileStore.new("tmp")
1512
sprockets_env.add_spec_paths_to_sprockets
1613
run Opal::Server.new(sprockets: sprockets_env) { |s|
1714
s.main = 'opal/rspec/sprockets_runner'
18-
s.append_path React::Rails::AssetVariant.new(addons: true).react_directory
1915
s.debug = false
2016
s.append_path 'spec/vendor'
2117
s.index_path = 'spec/index.html.erb'
2218
}
2319
else
2420
run Opal::Server.new { |s|
2521
s.main = 'opal/rspec/sprockets_runner'
26-
s.append_path React::Rails::AssetVariant.new(addons: true).react_directory
2722
s.append_path 'spec'
2823
s.append_path 'spec/vendor'
2924
s.debug = false

spec/spec_helper.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def ruby?
1515

1616
if RUBY_ENGINE == 'opal'
1717
require File.expand_path('../vendor/jquery-2.2.4.min', __FILE__)
18-
require 'react.js'
19-
require "react-server.js"
18+
require 'react/react-source'
2019
require 'reactive-ruby'
2120
require 'react/test/rspec'
2221

0 commit comments

Comments
 (0)