diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-16 22:35:18 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-24 20:10:14 +0900 |
commit | b9950c22b38456537af92c77210f1b837bdc914c (patch) | |
tree | 18f9e59af518c6f4bec3575bb8c56f3340aed155 /spec/lib/gitlab | |
parent | 14c0833c1c9f1633ab6d3e791decd57eb7422c4f (diff) | |
download | gitlab-ce-b9950c22b38456537af92c77210f1b837bdc914c.tar.gz |
Use each_line. Avoid comparison of partial. Add UTF-8 spec.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/ci/trace/stream_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/trace/stream_spec.rb b/spec/lib/gitlab/ci/trace/stream_spec.rb index d90ccf4f799..b4fdfd06daf 100644 --- a/spec/lib/gitlab/ci/trace/stream_spec.rb +++ b/spec/lib/gitlab/ci/trace/stream_spec.rb @@ -265,6 +265,17 @@ describe Gitlab::Ci::Trace::Stream do it { is_expected.to eq("98.29") } end + context 'when regex is multi-byte char' do + let(:data) { 'ゴッドファット\n' } + let(:regex) { 'ゴッドファット' } + + before do + stub_const('Gitlab::Ci::Trace::Stream::BUFFER_SIZE', 5) + end + + it { is_expected.to be_nil } + end + context 'when BUFFER_SIZE is equal to stream.size' do let(:data) { 'Coverage 1033 / 1051 LOC (98.29%) covered\n' } let(:regex) { '\(\d+.\d+\%\) covered' } |