From 38001685bbb3f3d59805c73e67dd4664983ca355 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Fri, 1 Aug 2025 12:53:24 +0300 Subject: [PATCH] Add repeat option to ci command The repeat option was only supported by the run command, but for convenience this adds it to the ci command. Specs are also added to ensure the option is available for both commands. Fixes #74 --- lib/mspec/commands/mspec-ci.rb | 1 + spec/commands/mspec_ci_spec.rb | 5 +++++ spec/commands/mspec_run_spec.rb | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/lib/mspec/commands/mspec-ci.rb b/lib/mspec/commands/mspec-ci.rb index 9959059..8951572 100644 --- a/lib/mspec/commands/mspec-ci.rb +++ b/lib/mspec/commands/mspec-ci.rb @@ -18,6 +18,7 @@ def options(argv = ARGV) options.chdir options.prefix options.configure { |f| load f } + options.repeat options.pretend options.interrupt options.timeout diff --git a/spec/commands/mspec_ci_spec.rb b/spec/commands/mspec_ci_spec.rb index bcbc5b4..b8dc9d0 100644 --- a/spec/commands/mspec_ci_spec.rb +++ b/spec/commands/mspec_ci_spec.rb @@ -78,6 +78,11 @@ @script.options [] end + it "enables the repeat option" do + expect(@options).to receive(:repeat) + @script.options @argv + end + it "calls #custom_options" do expect(@script).to receive(:custom_options).with(@options) @script.options [] diff --git a/spec/commands/mspec_run_spec.rb b/spec/commands/mspec_run_spec.rb index 62acd49..f96be2b 100644 --- a/spec/commands/mspec_run_spec.rb +++ b/spec/commands/mspec_run_spec.rb @@ -105,6 +105,11 @@ @script.options @argv end + it "enables the repeat option" do + expect(@options).to receive(:repeat) + @script.options @argv + end + it "exits if there are no files to process and './spec' is not a directory" do expect(File).to receive(:directory?).with("./spec").and_return(false) expect(@options).to receive(:parse).and_return([])