mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
parent
c62d70ea44
commit
46e96fb0a2
1 changed files with 11 additions and 0 deletions
|
@ -36,6 +36,17 @@ describe LogStash::Util::Accessors, :if => true do
|
|||
expect(data).to be_empty
|
||||
end
|
||||
|
||||
it "should handle delete on non-existent field" do
|
||||
str = "[foo][bar]"
|
||||
data = { "hello" => "world" }
|
||||
accessors = LogStash::Util::Accessors.new(data)
|
||||
expect(accessors.del(str)).to be_nil
|
||||
expect(data).not_to be_empty
|
||||
# assert no side effects
|
||||
expect(accessors.get("foo")).to be_nil
|
||||
expect(accessors.get("hello")).to eq("world")
|
||||
end
|
||||
|
||||
it "should set string value" do
|
||||
str = "simple"
|
||||
data = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue