diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-11-27 14:22:40 +0900 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-11-27 16:45:10 +0900 |
| commit | 26aebdb6d6ada732bf0aadd9062e65291c7cc413 (patch) | |
| tree | 7d3057f3bf97123a9c6261ce1c2947337760bfaf /spec | |
| parent | 671e6eb6447575e6acfd0b52e6ac9034c6611c0c (diff) | |
Added --env option to mspec for test-bundled-gems
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12179
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundled_gems.mspec | 2 | ||||
| -rw-r--r-- | spec/mspec/lib/mspec/commands/mspec-run.rb | 1 | ||||
| -rw-r--r-- | spec/mspec/lib/mspec/utils/options.rb | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/spec/bundled_gems.mspec b/spec/bundled_gems.mspec index 435f8b381a..f17f32f1b2 100644 --- a/spec/bundled_gems.mspec +++ b/spec/bundled_gems.mspec @@ -2,7 +2,7 @@ load File.dirname(__FILE__) + '/default.mspec' class MSpecScript test_bundled_gems = get(:stdlibs).to_a & get(:bundled_gems).to_a - unless ENV["BUNDLED_GEMS"].empty? + unless ENV["BUNDLED_GEMS"].nil? test_bundled_gems = ENV["BUNDLED_GEMS"].split(",").map do |gem| test_bundled_gems.find{|test_gem| test_gem.include?(gem) } end.compact diff --git a/spec/mspec/lib/mspec/commands/mspec-run.rb b/spec/mspec/lib/mspec/commands/mspec-run.rb index 4d8f4d9984..064c177d69 100644 --- a/spec/mspec/lib/mspec/commands/mspec-run.rb +++ b/spec/mspec/lib/mspec/commands/mspec-run.rb @@ -32,6 +32,7 @@ class MSpecRun < MSpecScript options.chdir options.prefix options.configure { |f| load f } + options.env options.randomize options.repeat options.pretend diff --git a/spec/mspec/lib/mspec/utils/options.rb b/spec/mspec/lib/mspec/utils/options.rb index 3b5962dbe6..23cf915e66 100644 --- a/spec/mspec/lib/mspec/utils/options.rb +++ b/spec/mspec/lib/mspec/utils/options.rb @@ -204,6 +204,13 @@ class MSpecOptions "Load FILE containing configuration options", &block) end + def env + on("--env", "KEY=VALUE", "Set environment variable") do |env| + key, value = env.split('=', 2) + ENV[key] = value + end + end + def targets on("-t", "--target", "TARGET", "Implementation to run the specs, where TARGET is:") do |t| @@ -484,6 +491,7 @@ class MSpecOptions def all configure {} + env targets formatters filters |
