Skip to content

Commit

Permalink
Add a test for install git gems will only clone once
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanitoFatas committed Apr 2, 2020
1 parent f8b9e89 commit eccf3d8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/installer_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require "test_helper"

require "gel/installer"

class InstallerTest < Minitest::Test
def test_install_git_gems_only_checkout_once
Dir.mktmpdir do |dir|
remote = "https://github.com/rails/rails.git"
revision = "d56d2e740612717334840b0d0ea979e1ca7cf5b1"
names = ["actioncable", "actionmailbox"]
store = Gel::Store.new(dir)
installer = Gel::Installer.new(store)
fake_download_pool = Minitest::Mock.new
installer.instance_variable_set(
:@download_pool,
fake_download_pool
)
fake_download_pool.expect(:queue, true) do |argument|
argument == "actioncable"
end

names.each do |name|
installer.load_git_gem(remote, revision, "actioncable")
end
end
end
end

0 comments on commit eccf3d8

Please sign in to comment.