summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-04-13 02:11:35 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-04-13 21:44:26 +0800
commitfaa5dffbcc0a2649ee8f427905d45d7061975bcb (patch)
tree2ab9fe2bda4263befc45e03b15391933e17d6912 /spec/support
parent7629c9ec57cb9b14f41c1163b61df1e6ea6b0ca1 (diff)
downloadgitlab-ce-faa5dffbcc0a2649ee8f427905d45d7061975bcb.tar.gz
After Trace#limit, we seek to the next line in case
of breaking ANSI sequence or Unicode
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/fixture_helpers.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/support/fixture_helpers.rb b/spec/support/fixture_helpers.rb
index a05c9d18002..5515c355cea 100644
--- a/spec/support/fixture_helpers.rb
+++ b/spec/support/fixture_helpers.rb
@@ -1,8 +1,11 @@
module FixtureHelpers
def fixture_file(filename)
return '' if filename.blank?
- file_path = File.expand_path(Rails.root.join('spec/fixtures/', filename))
- File.read(file_path)
+ File.read(expand_fixture_path(filename))
+ end
+
+ def expand_fixture_path(filename)
+ File.expand_path(Rails.root.join('spec/fixtures/', filename))
end
end