Skip to content

Commit

Permalink
Start working on a specs for LogStash::Event
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Oct 5, 2012
1 parent c1da025 commit b867be0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require "test_utils"
require "logstash/event"

describe "event tests" do
extend LogStash::RSpec

subject {
LogStash::Event.new("@fields" => { "foo" => "bar" })
}

it "should have @source == 'unknown'" do
insist { subject["@source"] } == "unknown"
end

it "should have a timestamp" do
insist { subject }.include?("@timestamp")
end

it "should have event['foo'] == 'bar'" do
insist { subject["foo"] } == "bar"
end
end

0 comments on commit b867be0

Please sign in to comment.