gitlab-org--gitlab-foss/spec/support/matchers/be_a_binary_string.rb

12 lines
249 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-11-23 05:48:57 -05:00
RSpec::Matchers.define :be_a_binary_string do |_|
match do |actual|
actual.is_a?(String) && actual.encoding == Encoding.find('ASCII-8BIT')
end
description do
"be a String with binary encoding"
end
end