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