Skip to content

Commit

Permalink
Added --env option to mspec for test-bundled-gems
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and andrykonchin committed Dec 9, 2024
1 parent a4ce98f commit c600b8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/mspec/commands/mspec-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def options(argv = ARGV)
options.chdir
options.prefix
options.configure { |f| load f }
options.env
options.randomize
options.repeat
options.pretend
Expand Down
8 changes: 8 additions & 0 deletions lib/mspec/utils/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ def configure(&block)
"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|
Expand Down Expand Up @@ -484,6 +491,7 @@ def debug

def all
configure {}
env
targets
formatters
filters
Expand Down

0 comments on commit c600b8f

Please sign in to comment.