summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2024-11-27 13:33:38 +0900
committerHiroshi SHIBATA <[email protected]>2024-11-27 16:45:10 +0900
commit671e6eb6447575e6acfd0b52e6ac9034c6611c0c (patch)
tree5f2a46979385a556c0ccc1703867321535eceab6 /spec
parent9349e98be23f1e6812f9b52c35cddb9d6bfe4762 (diff)
Run only specified bundled gems with BUNDLED_GEMS
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12179
Diffstat (limited to 'spec')
-rw-r--r--spec/bundled_gems.mspec9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/bundled_gems.mspec b/spec/bundled_gems.mspec
index 762fa1c165..435f8b381a 100644
--- a/spec/bundled_gems.mspec
+++ b/spec/bundled_gems.mspec
@@ -1,6 +1,13 @@
load File.dirname(__FILE__) + '/default.mspec'
class MSpecScript
- set :library, get(:stdlibs).to_a & get(:bundled_gems).to_a
+ test_bundled_gems = get(:stdlibs).to_a & get(:bundled_gems).to_a
+ unless ENV["BUNDLED_GEMS"].empty?
+ test_bundled_gems = ENV["BUNDLED_GEMS"].split(",").map do |gem|
+ test_bundled_gems.find{|test_gem| test_gem.include?(gem) }
+ end.compact
+ exit if test_bundled_gems.empty?
+ end
+ set :library, test_bundled_gems
set :files, get(:library)
end