File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ source "https://rubygems.org"
66gemspec
77
88gem "rake" , "~> 13.0"
9+ gem "test-unit"
10+ gem "test-unit-ruby-core"
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "bundler/gem_tasks"
4- task default : %i[ ]
4+ require "rake/testtask"
5+
6+ Rake ::TestTask . new ( :test ) do |t |
7+ t . libs << "test"
8+ t . libs << "lib"
9+ t . test_files = FileList [ "test/repl_completion/test_*.rb" ]
10+ end
11+
12+ # To make sure they have been correctly setup for Ruby CI.
13+ desc "Run each repl_completion test file in isolation."
14+ task :test_in_isolation do
15+ failed = false
16+
17+ FileList [ "test/repl_completion/test_*.rb" ] . each do |test_file |
18+ ENV [ "TEST" ] = test_file
19+ begin
20+ Rake ::Task [ "test" ] . execute
21+ rescue => e
22+ failed = true
23+ msg = "Test '#{ test_file } ' failed when being executed in isolation. Please make sure 'rake test TEST=#{ test_file } ' passes."
24+ separation_line = '=' * msg . length
25+
26+ puts <<~MSG
27+ #{ separation_line }
28+ #{ msg }
29+ #{ separation_line }
30+ MSG
31+ end
32+ end
33+
34+ fail "Some tests failed when being executed in isolation" if failed
35+ end
36+
37+ task default : %i[ test test_in_isolation ]
You can’t perform that action at this time.
0 commit comments