Sha256: 654be49bab618c734242845e34214c6ca7a961a9257a25c462df63d4c3a22212

Contents?: true

Size: 1006 Bytes

Versions: 6

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

require './lib/fusuma/plugin/events/event'
require './lib/fusuma/plugin/detectors/detector'
require './lib/fusuma/config'
require_relative '../buffers/dummy_buffer'
require_relative './dummy_detector'

module Fusuma
  module Plugin
    module Detectors
      RSpec.describe DummyDetector do
        before do
          @detector = DummyDetector.new
          @buffer = Buffers::DummyBuffer.new
        end

        around do |example|
          ConfigHelper.load_config_yml = <<~CONFIG
            plugin:
             detectors:
               dummy_detector:
                 dummy: dummy
          CONFIG

          example.run

          ConfigHelper.clear_config_yml
        end

        describe '#detect' do
          it { expect(@detector.detect([@buffer])).to be_a(Events::Event) }
        end

        describe '#config_params' do
          it { expect(@detector.config_params).to eq(dummy: 'dummy') }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fusuma-2.4.1 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.4.0 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.3.0 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.2.0 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.1.0 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.0.5 spec/lib/plugin/detectors/detector_spec.rb