-
-
Notifications
You must be signed in to change notification settings - Fork 95
/
Rakefile
45 lines (38 loc) · 1.03 KB
/
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
40
41
42
43
44
45
# frozen_string_literal: true
require "bundler/gem_tasks"
require "pathname"
desc "Run all specs"
task test: ["run_spec:all_specs"]
task default: :test
namespace :run_spec do
desc "Run shakapacker specs"
task :gem do
puts "Running Shakapacker gem specs"
sh("bundle exec rspec spec/shakapacker/*_spec.rb")
end
desc "Run specs in the dummy app"
task :dummy do
puts "Running dummy app specs"
spec_dummy_dir = Pathname.new(File.join("spec", "dummy")).realpath
Bundler.with_unbundled_env do
sh_in_dir(".", "yalc publish")
sh_in_dir(spec_dummy_dir, [
"bundle install",
"yalc link shakapacker",
"yarn install",
"bundle exec rspec"
])
end
end
desc "Run generator specs"
task :generator do
sh("bundle exec rspec spec/generator_specs/*_spec.rb")
end
desc "Run all specs"
task all_specs: %i[gem dummy generator] do
puts "Completed all RSpec tests"
end
end
def sh_in_dir(dir, *shell_commands)
Shakapacker::Utils::Misc.sh_in_dir(dir, *shell_commands)
end