Sha256: 7fc06ab4f72b19a5073b436e2e06e78cadb88e2a4292afcd79afd42fd9d85536

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

require_relative '../../../test_helper'
require_relative '../../../../lib/vedeu/parsing/hash_parser'

module Vedeu
  describe HashParser do
    describe '.parse' do
      it 'returns a Hash when the output is content for multiple interfaces' do
        HashParser.parse({
          test:  'Some content...',
          dummy: 'More content...'
        }).must_equal({
          interfaces: [
            { name: 'test', lines:  [
              { streams: { text: 'Some content...' } }] },
            { name: 'dummy', lines: [
              { streams: { text: 'More content...' } }] }
          ]
        })
      end

      it 'returns a Hash when the output is content for a single interface' do
        HashParser.parse({
          dummy: 'Some content...'
        }).must_equal({
          interfaces: [
            { name: 'dummy', lines: [
              { streams: { text: 'Some content...' } }] }
          ]
        })
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.37 test/lib/vedeu/parsing/hash_parser_test.rb