mirror of
https://github.com/discourse/discourse.git
synced 2024-12-25 05:03:42 +08:00
52894b9d7c
It will help to find out the current version of the plugins even without the `docker_manager` plugin.
18 lines
663 B
Ruby
18 lines
663 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe GitRepo do
|
|
let(:git_repo) { GitRepo.new("/tmp", "discourse") }
|
|
|
|
it "returns the correct URL" do
|
|
Discourse::Utils.stubs(:execute_command).returns("https://github.com/username/my_plugin.git")
|
|
expect(git_repo.url).to eq("https://github.com/username/my_plugin")
|
|
Discourse::Utils.stubs(:execute_command).returns("git@github.com/username/my_plugin.git")
|
|
expect(git_repo.url).to eq("https://github.com/username/my_plugin")
|
|
end
|
|
|
|
it "returns the correct commit hash" do
|
|
Discourse::Utils.expects(:execute_command).returns("123456")
|
|
expect(git_repo.latest_local_commit).to eq("123456")
|
|
end
|
|
end
|