-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathfunctions_spec.rb
59 lines (48 loc) · 1.24 KB
/
functions_spec.rb
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# typed: false
# frozen_string_literal: true
require "native_spec_helper"
require "shared_contexts"
RSpec.describe Functions do
include_context "when in a temporary bundler directory"
describe "#jfrog_source" do
let(:project_name) { "jfrog_source" }
it "returns the jfrog source" do
in_tmp_folder do
jfrog_source = described_class.jfrog_source(
dir: tmp_path,
gemfile_name: "Gemfile",
credentials: {}
)
expect(jfrog_source).to eq("test.jfrog.io")
end
end
end
describe "#git_specs" do
subject(:git_specs) do
in_tmp_folder do
described_class.git_specs(
dir: tmp_path,
gemfile_name: "Gemfile",
credentials: {}
)
end
end
let(:project_name) { "git_source" }
def expect_specs(count)
expect(git_specs.size).to eq(count)
git_specs.each do |gs|
uri = URI.parse(gs[:auth_uri])
expect(uri.scheme).to(satisfy { |s| s.match?(/https?/o) })
end
end
it "returns git specs" do
expect_specs(4)
end
context "with github shorthand" do
let(:project_name) { "github_source" }
it "returns git specs" do
expect_specs(1)
end
end
end
end