Add another case for block testing

This commit is contained in:
Jordan Sissel 2013-08-08 23:23:54 -07:00
parent 9591c97448
commit ad3839f4c1

View file

@ -38,4 +38,13 @@ describe LogStash::Util::HashEval, :if => true do
# Make sure the "world" key is removed.
insist { data["hello"] } == { "bar" => "baz" }
end
it "should permit blocks #2" do
str = "simple"
code = subject.compile(str)
m = eval(subject.compile(str))
data = { "simple" => "things" }
m.call(data) { |obj, key| obj.delete(key) }
insist { data }.empty?
end
end