Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created January 7, 2017 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unicolet/c2a54a452cc30200fb298eef43be9c1a to your computer and use it in GitHub Desktop.
Save unicolet/c2a54a452cc30200fb298eef43be9c1a to your computer and use it in GitHub Desktop.
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
files = Dir['conf.d/*.conf']
@@configuration = String.new
files.sort.each do |file|
@@configuration << File.read(file)
end
describe "simple test" do
config(@@configuration)
sample(
"message" => "my message",
"type" => "log",
"time" => "2016-12-26T10:58:05.0Z",
"source" => "stdout"
) do
insist { subject.get("type") } == "log"
insist { subject.get("source") } == "stdout"
insist { subject.get("message") } == "my message"
insist { subject.include?("log") } == false
insist { subject.timestamp.to_i } == Time.iso8601("2016-12-26T10:58:05.0Z").to_i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment