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:
authorLin Jen-Shin <godfat@godfat.org>2017-04-17 09:30:42 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-04-17 09:30:42 +0300
commitee3b0c3a9ad0823f86b5c798c47c343a812228d0 (patch)
treec68fa2a725056ea2d0e067bd84bbc1be5d00bd05 /spec/lib/gitlab/ci
parenteeaeb2752a589c9046659d58d4a3f6be8030b699 (diff)
Make sure we're giving Encoding.default_external
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/trace/stream_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/trace/stream_spec.rb b/spec/lib/gitlab/ci/trace/stream_spec.rb
index 9e3bd6d662f..4bbca6d2ea2 100644
--- a/spec/lib/gitlab/ci/trace/stream_spec.rb
+++ b/spec/lib/gitlab/ci/trace/stream_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe Gitlab::Ci::Trace::Stream do
describe 'delegates' do
- subject { described_class.new { nil } }
+ subject { described_class.new { StringIO.new } }
it { is_expected.to delegate_method(:close).to(:stream) }
it { is_expected.to delegate_method(:tell).to(:stream) }
@@ -43,13 +43,19 @@ describe Gitlab::Ci::Trace::Stream do
it 'forwards to the next linefeed, case 1' do
stream.limit(7)
- expect(stream.raw).to eq('')
+ result = stream.raw
+
+ expect(result).to eq('')
+ expect(result.encoding).to eq(Encoding.default_external)
end
it 'forwards to the next linefeed, case 2' do
stream.limit(29)
- expect(stream.raw).to eq("\e[01;32m許功蓋\e[0m\n")
+ result = stream.raw
+
+ expect(result).to eq("\e[01;32m許功蓋\e[0m\n")
+ expect(result.encoding).to eq(Encoding.default_external)
end
end
end