Sha256: d9f60e42ccfbf6527112d8948efd1a19d6de1ad746fc873aaaa0a0e920a29f53

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'
require 'vedeu/support/menu'
require 'vedeu/output/menu_parser'

module Vedeu
  describe MenuParser do
    describe '.parse' do
      it 'returns an interface' do
        items  = [
          [false, true,  'Hydrogen'],
          [true,  false, 'Helium'],
          [false, false, 'Lithium'],
          [true,  true,  'Beryllium']
        ]
        args   = ['dummy', items]
        parser = MenuParser.parse(args)
        parser.must_equal(
          {
            interfaces: {
              name:  'dummy',
              lines: [
                {
                  streams: {
                    text: ' > Hydrogen'
                  }
                }, {
                  streams: {
                    text: '*  Helium'
                  }
                }, {
                  streams: {
                    text: '   Lithium'
                  }
                }, {
                  streams: {
                    text: '*> Beryllium'
                  }
                }
              ]
            }
          }
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.6 test/lib/vedeu/output/menu_parser_test.rb
vedeu-0.1.5 test/lib/vedeu/output/menu_parser_test.rb