Testing Ruby For Logstash Event Object

I am planning on writing some unit test for a ruby code i have written.

Here is the snippet:

require 'minitest/autorun'

describe "Test Event Object" do


    before do
        @event = new Event()
    end

    it "should add key value to the event" do
        @event.set('test', 'value')
        puts @event
    end
end

But it gives me error

1) Error:
Test Event Object#test_0001_should add key value to the event:
NoMethodError: undefined method `Event' for #<#<Class:0x00007f9e6a964bb8>:0x00007f9e6d849870>
    eventObject.spec.rb:7:in `block (2 levels) in <main>'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

Any idea how i can import Event object used by Logstash?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.