Skip to content

Commit

Permalink
lint: fix spec/unit/sanitiser
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Dec 16, 2024
1 parent 13895bb commit dd5e5d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/unit/sanitiser/strategy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RSpec.describe Sanitiser::Strategy do
context "with sanitize_null_bytes true" do
it "raises an error if the string contains a null byte" do
expect { described_class.call("Hello\x00World!", sanitize_null_bytes: true) }.to raise_error(Sanitiser::Strategy::SanitisingError)
end
end

context "with sanitize_null_bytes false" do
it "does not raise an error if the string contains a null byte" do
expect { described_class.call("Hello\x00World!", sanitize_null_bytes: false) }.not_to raise_error
end
end
end

0 comments on commit dd5e5d0

Please sign in to comment.