Sha256: 7c929a6d1a99c90d3ac8879ead436476d552f55b6e48b765e8d3165bf1e92978

Contents?: true

Size: 817 Bytes

Versions: 36

Compression:

Stored size: 817 Bytes

Contents

# frozen_string_literal: true

require 'eac_cli/docopt/runner_extension'

RSpec.describe ::EacCli::Docopt::RunnerExtension do
  let(:stub_runner) do
    r = Class.new(::EacRubyUtils::Console::DocoptRunner) do
      def run; end
    end
    r.include ::EacCli::Runner
    r.runner_definition do
      desc 'A stub runner.'
      arg_opt '-o', '--opt1', 'A argument option'
      pos_arg 'pos1'
    end
    r
  end

  let(:instance) { stub_runner.new(argv: %w[-o aaa bbb]) }

  before { instance.run }

  it { expect(instance.options.fetch('--opt1')).to eq('aaa') }
  it { expect(instance.options.fetch('<pos1>')).to eq('bbb') }
  it { expect(instance.doc).to eq(<<~EXPECTED) }
    A stub runner.

    Usage:
      __PROGRAM__ [options] <pos1>

    Options:
      -o --opt1=<value>    A argument option

  EXPECTED
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
avm-tools-0.98.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.97.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.96.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.95.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.94.3 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.94.2 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.94.1 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
ehbrs-tools-0.20.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.94.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.93.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.92.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.91.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.90.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.89.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.88.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.87.1 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
ehbrs-tools-0.19.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
ehbrs-tools-0.18.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
avm-tools-0.87.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb
ehbrs-tools-0.17.0 vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb