From 5571dc766e2143e39762ff0b47c41d1c2e154f4c Mon Sep 17 00:00:00 2001 From: Benjamin Sanders Date: Sat, 11 Oct 2025 10:34:24 -0400 Subject: Vendor bundled gems for deployment --- .../gems/mercenary-0.4.0/spec/command_spec.rb | 98 ++++++++++++++++++++++ .../3.4.0/gems/mercenary-0.4.0/spec/option_spec.rb | 84 +++++++++++++++++++ .../gems/mercenary-0.4.0/spec/presenter_spec.rb | 45 ++++++++++ .../gems/mercenary-0.4.0/spec/program_spec.rb | 19 +++++ .../3.4.0/gems/mercenary-0.4.0/spec/spec_helper.rb | 16 ++++ 5 files changed, 262 insertions(+) create mode 100644 vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/command_spec.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/option_spec.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/presenter_spec.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/program_spec.rb create mode 100644 vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/spec_helper.rb (limited to 'vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec') diff --git a/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/command_spec.rb b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/command_spec.rb new file mode 100644 index 0000000..85d766b --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/command_spec.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe(Mercenary::Command) do + context "a basic command" do + let(:command) { Mercenary::Command.new(:my_name) } + let(:parent) { Mercenary::Command.new(:my_parent) } + let(:with_sub) do + c = Mercenary::Command.new(:i_have_subcommand) + add_sub.call(c) + c + end + let(:command_with_parent) do + Mercenary::Command.new( + :i_have_parent, + parent + ) + end + let(:add_sub) do + proc do |c| + c.command(:sub_command) { |p| } + end + end + + it "can be created with just a name" do + expect(command.name).to eql(:my_name) + end + + it "can hold a parent command" do + expect(command_with_parent.parent).to eql(parent) + end + + it "can create subcommands" do + expect(add_sub.call(command)).to be_a(Mercenary::Command) + expect(add_sub.call(command).parent).to eq(command) + end + + it "can set its version" do + version = "1.4.2" + command.version version + expect(command.version).to eq(version) + end + + it "can set its syntax" do + syntax_string = "my_name [options]" + cmd = described_class.new(:my_name) + cmd.syntax syntax_string + expect(cmd.syntax).to eq(syntax_string) + end + + it "can set its description" do + desc = "run all the things" + command.description desc + expect(command.description).to eq(desc) + end + + it "can set its options" do + name = "show_drafts" + opts = ["--drafts", "Render posts in the _drafts folder"] + option = Mercenary::Option.new(name, opts) + command.option name, *opts + expect(command.options).to eql([option]) + expect(command.map.values).to include(name) + end + + it "knows its full name" do + expect(command_with_parent.full_name).to eql("my_parent i_have_parent") + end + + it "knows its identity" do + command_with_parent.version "1.8.7" + expect(command_with_parent.identity).to eql("my_parent i_have_parent 1.8.7") + end + + it "raises an ArgumentError if I specify a default_command that isn't there" do + c = command # some weird NameError with the block below? + expect { c.default_command(:nope) }.to raise_error(ArgumentError) + end + + it "sets the default_command" do + expect(with_sub.default_command(:sub_command).name).to eq(:sub_command) + end + + context "with an alias" do + before(:each) do + command_with_parent.alias(:an_alias) + end + it "shows the alias in the summary" do + expect(command_with_parent.summarize).to eql(" i_have_parent, an_alias ") + end + + it "its names_and_aliases method reports both the name and alias" do + expect(command_with_parent.names_and_aliases).to eql("i_have_parent, an_alias") + end + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/option_spec.rb b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/option_spec.rb new file mode 100644 index 0000000..ce10a62 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/option_spec.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe(Mercenary::Option) do + let(:config_key) { "largo" } + let(:description) { "This is a description" } + let(:switches) { ["-l", "--largo"] } + let(:option) { described_class.new(config_key, [switches, description].flatten.reject(&:nil?)) } + + it "knows its config key" do + expect(option.config_key).to eql(config_key) + end + + it "knows its description" do + expect(option.description).to eql(description) + end + + it "knows its switches" do + expect(option.switches).to eql(switches) + end + + it "knows how to present itself" do + expect(option.to_s).to eql(" -l, --largo #{description}") + end + + it "has an OptionParser representation" do + expect(option.for_option_parser).to eql([switches, description].flatten) + end + + it "compares itself with other options well" do + new_option = described_class.new(config_key, ["-l", "--largo", description]) + expect(option.eql?(new_option)).to be(true) + expect(option.hash.eql?(new_option.hash)).to be(true) + end + + it "has a custom #hash" do + expect(option.hash.to_s).to match(%r!\d+!) + end + + context "with just the long switch" do + let(:switches) { ["--largo"] } + + it "adds an empty string in place of the short switch" do + expect(option.switches).to eql(["", "--largo"]) + end + + it "sets its description properly" do + expect(option.description).to eql(description) + end + + it "knows how to present the switch" do + expect(option.formatted_switches).to eql(" --largo ") + end + end + + context "with just the short switch" do + let(:switches) { ["-l"] } + + it "adds an empty string in place of the long switch" do + expect(option.switches).to eql(["-l", ""]) + end + + it "sets its description properly" do + expect(option.description).to eql(description) + end + + it "knows how to present the switch" do + expect(option.formatted_switches).to eql(" -l ") + end + end + + context "without a description" do + let(:description) { nil } + + it "knows there is no description" do + expect(option.description).to be(nil) + end + + it "knows both inputs are switches" do + expect(option.switches).to eql(switches) + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/presenter_spec.rb b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/presenter_spec.rb new file mode 100644 index 0000000..b72dbae --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/presenter_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe(Mercenary::Presenter) do + let(:supercommand) { Mercenary::Command.new(:script_name) } + let(:command) { Mercenary::Command.new(:subcommand, supercommand) } + let(:presenter) { described_class.new(command) } + + before(:each) do + supercommand.option "version", "-v", "--version", "Show version" + supercommand.option "help", "-h", "--help", "Help!" + + command.version "1.4.2" + command.description "Do all the things." + command.option "help", "-h", "--help", "Help!" + command.option "one", "-1", "--one", "The first option" + command.option "two", "-2", "--two", "The second option" + command.alias :cmd + supercommand.commands[command.name] = command + end + + it "knows how to present the command" do + expect(presenter.command_presentation).to eql("script_name subcommand 1.4.2 -- Do all the things.\n\nUsage:\n\n script_name subcommand\n\nOptions:\n -1, --one The first option\n -2, --two The second option\n -v, --version Show version\n -h, --help Help!") + end + + it "knows how to present the subcommands, without duplicates for aliases" do + expect(described_class.new(supercommand).subcommands_presentation).to eql(" subcommand, cmd Do all the things.") + end + + it "knows how to present the usage" do + expect(presenter.usage_presentation).to eql(" script_name subcommand") + end + + it "knows how to present the options" do + expect(presenter.options_presentation).to eql(" -1, --one The first option\n -2, --two The second option\n -v, --version Show version\n -h, --help Help!") + end + + it "allows you to say print_* instead of *_presentation" do + expect(presenter.print_usage).to eql(presenter.usage_presentation) + expect(presenter.print_subcommands).to eql(presenter.subcommands_presentation) + expect(presenter.print_options).to eql(presenter.options_presentation) + expect(presenter.print_command).to eql(presenter.command_presentation) + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/program_spec.rb b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/program_spec.rb new file mode 100644 index 0000000..aeb667b --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/program_spec.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe(Mercenary::Program) do + context "a basic program" do + let(:program) { Mercenary::Program.new(:my_name) } + + it "can be created with just a name" do + expect(program.name).to eql(:my_name) + end + + it "can set its version" do + version = Mercenary::VERSION + program.version version + expect(program.version).to eq(version) + end + end +end diff --git a/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/spec_helper.rb b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/spec_helper.rb new file mode 100644 index 0000000..42801c7 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/mercenary-0.4.0/spec/spec_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +lib = File.expand_path("../lib", __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require "mercenary" + +RSpec.configure do |config| + config.run_all_when_everything_filtered = true + config.filter_run :focus + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = "random" +end -- cgit v1.2.3