Sha256: 1b6f633fd467d3fae00de80276ea3a6b40ce65908a03dab4605f912b6fa6ec7f

Contents?: true

Size: 993 Bytes

Versions: 10

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require './lib/fusuma/plugin/parsers/parser'
require './lib/fusuma/plugin/events/event'

module Fusuma
  module Plugin
    module Parsers
      class DummyParser < Parser
        DEFAULT_SOURCE = 'dummy_input'
      end

      RSpec.describe Parser do
        let(:parser) { DummyParser.new }

        around do |example|
          ConfigHelper.load_config_yml = <<~CONFIG
            plugin:
             parsers:
               dummy_parser:
                 dummy: dummy
          CONFIG

          example.run

          Config.custom_path = nil
        end

        describe '#source' do
          subject { parser.source }

          it { is_expected.to be DummyParser::DEFAULT_SOURCE }
        end

        describe '#parse' do
          subject { parser.parse(event) }
          let(:event) { Events::Event.new(tag: 'dummy_input', record: 'dummy') }

          it { is_expected.to be event }
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fusuma-2.4.1 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.4.0 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.3.0 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.2.0 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.1.0 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.0.5 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.0.4 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.0.3 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.0.2 spec/lib/plugin/parsers/parser_spec.rb
fusuma-2.0.1 spec/lib/plugin/parsers/parser_spec.rb