Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2017-11-23 13:48:57 +0300
committerRémy Coutable <remy@rymai.me>2017-11-23 13:48:57 +0300
commit4cfcc97544c231c2baf8dc3ab232ed394355b62c (patch)
tree0914bf3d34b8311d210ef94c5af341417dc76286 /spec/support/matchers
parentffa2a98034fb300f0e0d4ac438031f95a4359441 (diff)
Fix encoding bugs in Gitlab::Git::User
Diffstat (limited to 'spec/support/matchers')
-rw-r--r--spec/support/matchers/be_a_binary_string.rb9
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