Commit e5b20b83 authored by Ahmad Sherif's avatar Ahmad Sherif

Use StringIO#string instead of #rewind/#read combo

parent dd7648d9
......@@ -26,8 +26,7 @@ module GitLab
buffer.write(" #{measurement[:value]} #{measurement[:timestamp]}\n")
end
end
buffer.rewind
buffer.read
buffer.string
end
end
end
......
......@@ -40,15 +40,13 @@ context "With valid pair of repositories" do
it "probes and monitors a pull" do
prober = GitLab::Monitor::GitProber.new(options)
prober.probe_pull.write_to(output)
output.rewind
expect(output.read).to match(/git_pull_time_milliseconds \d+ \d+/)
expect(output.string).to match(/git_pull_time_milliseconds \d+ \d+/)
end
it "probes and monitors a push" do
prober = GitLab::Monitor::GitProber.new(options)
prober.probe_push.write_to(output)
output.rewind
expect(output.read).to match(/git_push_time_milliseconds \d+ \d+/)
expect(output.string).to match(/git_push_time_milliseconds \d+ \d+/)
end
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