Sha256: e037cf0699821e8acdc5f9a4c942391d6144f89cf0ad105b5aa291747bb88376

Contents?: true

Size: 968 Bytes

Versions: 4

Compression:

Stored size: 968 Bytes

Contents

require_relative '../../../../test_helper'
require_relative '../../../../../lib/vedeu/support/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

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.0.36 test/lib/vedeu/support/parsing/hash_parser_test.rb
vedeu-0.0.35 test/lib/vedeu/support/parsing/hash_parser_test.rb
vedeu-0.0.34 test/lib/vedeu/support/parsing/hash_parser_test.rb
vedeu-0.0.33 test/lib/vedeu/support/parsing/hash_parser_test.rb