blob: f7475a35aa955910d6b6354c0496577cc2d87bfc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# frozen_string_literal: true
RSpec.describe Bundler::Source::Git do
before do
allow(Bundler).to receive(:root) { Pathname.new("root") }
end
let(:uri) { "https://github.com/foo/bar.git" }
let(:options) do
{ "uri" => uri }
end
subject { described_class.new(options) }
describe "#to_s" do
it "returns a description" do
expect(subject.to_s).to eq "https://github.com/foo/bar.git (at master)"
end
context "when the URI contains credentials" do
let(:uri) { "https://my-secret-token:x-oauth-basic@github.com/foo/bar.git" }
it "filters credentials" do
expect(subject.to_s).to eq "https://x-oauth-basic@github.com/foo/bar.git (at master)"
end
end
end
end
|