Sha256: 98a5aa7c87685ee6818a3462230b1b5c0beb29586d08ae5ee692306adb37abc7

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 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

          Config.custom_path = nil
        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

4 entries across 4 versions & 1 rubygems

Version Path
fusuma-2.0.4 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.0.3 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.0.2 spec/lib/plugin/detectors/detector_spec.rb
fusuma-2.0.1 spec/lib/plugin/detectors/detector_spec.rb