diff options
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 |
