Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic test for the dot encode and decode
Fixes #3
- Loading branch information
1 parent
adb9319
commit 3ca22a8
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
require "logstash/devutils/rspec/spec_helper" | ||
# encoding: utf-8 | ||
|
||
require_relative "../spec_helper" | ||
require "logstash/plugin" | ||
require "logstash/event" | ||
|
||
describe LogStash::Codecs::Dots do | ||
|
||
it "should initialize without errors" do | ||
klass = LogStash::Plugin.lookup("codec", "dots") | ||
expect { klass.new }.to_not raise_error | ||
end | ||
|
||
describe "event encoding" do | ||
|
||
let(:properties) { {:name => "foo" } } | ||
let(:event) { LogStash::Event.new(properties) } | ||
|
||
it "should encode as a dot" do | ||
subject.on_event do |event, data| | ||
expect(data).to eq(".") | ||
end | ||
subject.encode(event) | ||
end | ||
|
||
end | ||
|
||
describe "event decoding" do | ||
|
||
it "should raise an exception" do | ||
expect { subject.decode }.to raise_error | ||
end | ||
|
||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "logstash/devutils/rspec/spec_helper" | ||
require "logstash/codecs/dots" |