Permalink
Browse files

Start working on a specs for LogStash::Event

  • Loading branch information...
1 parent c1da025 commit b867be0567f3490fadc6d06b2478d12d3119076f @jordansissel jordansissel committed Oct 5, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 spec/event.rb
View
@@ -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.