Commit 9cc719c3 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Use String#strip_heredoc temporarily until we upgrade CI to use Ruby 2.3

parent ac211af7
......@@ -89,7 +89,7 @@ describe GitLab::Monitor::Database do
ci_running_builds{runner="2",shared_runner="no",mirror="yes",pending_delete="no",mirror_trigger_builds="yes"} 5
OUTPUT
expect(writer.string).to eq(output.gsub(/^ {8}/, ""))
expect(writer.string).to eq(output.strip_heredoc)
end
end
end
......@@ -4,6 +4,9 @@ require "gitlab_monitor"
require "open3"
require "tmpdir"
$LOAD_PATH.unshift File.expand_path(".")
Dir["spec/support/**/*.rb"].each do |f| require f end
class GitRepoBuilder
def origin
@origin ||= create_origin
......
class String
# Copied from activesupport gem
def strip_heredoc
gsub(/^#{scan(/^[ \t]*(?=\S)/).min}/, "".freeze)
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment