add these encoding specs for Event#validate_value
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
These specs were originally written for the `Accessor` class and the `strict_set` method used with rspec but now this has been refactored using `Event#validate_value`.
These encoding specs could probably be incorporated in the `Event` specs?
relates to #3290
``` ruby
# should we move this in Event#validate_value specs?
#
# context "using invalid encoding" do
# it "strinct_set should raise on non UTF-8 string encoding" do
# str = "[hello]"
# data = {}
# accessors = LogStash::Util::Accessors.new(data)
# expect { accessors.strict_set(str, "foo".encode("US-ASCII")) }.to raise_error
# end
# it "strinct_set should raise on non UTF-8 string encoding in array" do
# str = "[hello]"
# data = {}
# accessors = LogStash::Util::Accessors.new(data)
# expect { accessors.strict_set(str, ["foo", "bar".encode("US-ASCII")]) }.to raise_error
# end
# it "strinct_set should raise on invalid UTF-8 string encoding" do
# str = "[hello]"
# data = {}
# accessors = LogStash::Util::Accessors.new(data)
# expect { accessors.strict_set(str, "foo \xED\xB9\x81\xC3") }.to raise_error
# end
# it "strinct_set should raise on invalid UTF-8 string encoding in array" do
# str = "[hello]"
# data = {}
# accessors = LogStash::Util::Accessors.new(data)
# expect { accessors.strict_set(str, ["foo", "bar \xED\xB9\x81\xC3"]) }.to raise_error
# end
# end
```
Contributor guide
Assessment
This issue has not been assessed yet.