Sha256: 4bdc54ba55df34b5c6edfa16f37b5f8c09cec873ebaf45b1104f1fe6808a02c6

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

require_relative '../../../test_helper'

module Troo
  module CLI
    describe ThorFixes do
      let(:described_class) { ThorFixes }
      let(:command)         { stub(usage: 'usage') }
      let(:namespace)       {}
      let(:subcommand)      {}
      let(:package_name)    {}

      describe '.banner' do
        before do
          described_class
            .instance_variable_set('@package_name', package_name)
        end

        subject do
          described_class.banner(command, namespace, subcommand)
        end

        context 'when executing a subcommand' do
          let(:package_name) { 'show' }

          it 'package_name has a leading space' do
            subject.must_match(/show usage/)
          end
        end

        context 'when executing a top-level command' do
          it 'package_name does not have a leading space' do
            subject.must_match(/\s{1}usage/)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
troo-0.0.12 test/lib/troo/cli/thor_fixes_test.rb
troo-0.0.11 test/lib/troo/cli/thor_fixes_test.rb
troo-0.0.10 test/lib/troo/cli/thor_fixes_test.rb
troo-0.0.9 test/lib/troo/cli/thor_fixes_test.rb