Created
January 7, 2017 14:04
-
-
Save unicolet/c2a54a452cc30200fb298eef43be9c1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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