diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-17 15:05:18 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-24 20:10:14 +0900 |
commit | a6f6056c62693f18d9a2da570578b2e19aa20afe (patch) | |
tree | cdf3014611990a7b1d71526392afa05097647015 /spec | |
parent | b9950c22b38456537af92c77210f1b837bdc914c (diff) | |
download | gitlab-ce-a6f6056c62693f18d9a2da570578b2e19aa20afe.tar.gz |
Use force_encoding when regex contains UTF-8 char
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/ci/trace/stream_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/trace/stream_spec.rb b/spec/lib/gitlab/ci/trace/stream_spec.rb index b4fdfd06daf..bbb3f9912a3 100644 --- a/spec/lib/gitlab/ci/trace/stream_spec.rb +++ b/spec/lib/gitlab/ci/trace/stream_spec.rb @@ -266,14 +266,14 @@ describe Gitlab::Ci::Trace::Stream do end context 'when regex is multi-byte char' do - let(:data) { 'ゴッドファット\n' } - let(:regex) { 'ゴッドファット' } + let(:data) { '95.0 ゴッドファット\n' } + let(:regex) { '\d+\.\d+ ゴッドファット' } before do stub_const('Gitlab::Ci::Trace::Stream::BUFFER_SIZE', 5) end - it { is_expected.to be_nil } + it { is_expected.to eq('95.0') } end context 'when BUFFER_SIZE is equal to stream.size' do |