be_a_binary_string.rb 218 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 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