diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2017-11-23 13:48:57 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-23 13:48:57 +0300 |
commit | 4cfcc97544c231c2baf8dc3ab232ed394355b62c (patch) | |
tree | 0914bf3d34b8311d210ef94c5af341417dc76286 /spec/support/matchers | |
parent | ffa2a98034fb300f0e0d4ac438031f95a4359441 (diff) |
Fix encoding bugs in Gitlab::Git::User
Diffstat (limited to 'spec/support/matchers')
-rw-r--r-- | spec/support/matchers/be_a_binary_string.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/matchers/be_a_binary_string.rb b/spec/support/matchers/be_a_binary_string.rb new file mode 100644 index 00000000000..f041ae76167 --- /dev/null +++ b/spec/support/matchers/be_a_binary_string.rb @@ -0,0 +1,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 |