Sha256: 1c9afbb3059a88c38ac2e4a93022b5a9bd3ab16513cf35afbdc0dc3e780e13f4

Contents?: true

Size: 756 Bytes

Versions: 31

Compression:

Stored size: 756 Bytes

Contents

require File.join(File.dirname(__FILE__), '../../test_helper')

describe HammerCLI::Help::Section do
  describe '#build_string' do
    let(:section)     { HammerCLI::Help::Section.new('section') }
    let(:first_text)  { HammerCLI::Help::Text.new('first') }
    let(:second_text) { HammerCLI::Help::Text.new('second') }

    it 'builds string without definition' do
      section.build_string.must_equal "section:\n\n"
    end

    it 'builds string with definition' do
      section.definition = HammerCLI::Help::Definition.new([first_text, second_text])
      expected_output =  [
        'section:',
        '  first',
        '',
        '  second',
        ''
      ].join("\n")
      section.build_string.must_equal expected_output
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hammer_cli-3.7.0 test/unit/help/definition/section_test.rb
hammer_cli-3.5.1 test/unit/help/definition/section_test.rb
hammer_cli-3.6.0 test/unit/help/definition/section_test.rb
hammer_cli-3.5.0 test/unit/help/definition/section_test.rb
hammer_cli-3.4.0 test/unit/help/definition/section_test.rb
hammer_cli-3.3.0 test/unit/help/definition/section_test.rb
hammer_cli-3.2.0 test/unit/help/definition/section_test.rb
hammer_cli-3.1.1 test/unit/help/definition/section_test.rb
hammer_cli-3.0.2 test/unit/help/definition/section_test.rb
hammer_cli-3.1.0 test/unit/help/definition/section_test.rb
hammer_cli-3.0.1 test/unit/help/definition/section_test.rb
hammer_cli-3.0.0 test/unit/help/definition/section_test.rb
hammer_cli-2.5.1 test/unit/help/definition/section_test.rb
hammer_cli-2.5.0 test/unit/help/definition/section_test.rb
hammer_cli-2.3.1 test/unit/help/definition/section_test.rb
hammer_cli-2.4.0 test/unit/help/definition/section_test.rb
hammer_cli-2.3.0 test/unit/help/definition/section_test.rb
hammer_cli-2.2.1 test/unit/help/definition/section_test.rb
hammer_cli-2.1.2 test/unit/help/definition/section_test.rb
hammer_cli-2.2.0 test/unit/help/definition/section_test.rb