forked from ruby-hyperloop/hyper-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (31 loc) · 996 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'bundler'
Bundler.require
Bundler::GemHelper.install_tasks
# Store the BUNDLE_GEMFILE env, since rake or rspec seems to clean it
# while invoking task.
ENV['REAL_BUNDLE_GEMFILE'] = ENV['BUNDLE_GEMFILE']
require 'rspec/core/rake_task'
require 'opal/rspec/rake_task'
begin
require "react-rails"
rescue NameError
end
RSpec::Core::RakeTask.new('ruby:rspec')
Opal::RSpec::RakeTask.new('opal:rspec') do |s, task|
s.append_path React::Rails::AssetVariant.new(addons: true).react_directory
s.append_path 'spec/vendor'
s.index_path = 'spec/index.html.erb'
task.timeout = 80000 if task
end
task :test do
Rake::Task['ruby:rspec'].invoke
Rake::Task['opal:rspec'].invoke
end
require 'generators/reactive_ruby/test_app/test_app_generator'
desc "Generates a dummy app for testing"
task :test_app do
ReactiveRuby::TestAppGenerator.start
puts "Setting up test app database..."
system("bundle exec rake db:drop db:create db:migrate > #{File::NULL}")
end
task default: [ :test ]