Sha256: 4af0a5e09ec378ac4cf3f3f6cef0fa0815a8b4ba3bc18a1660d9797a898fff89

Contents?: true

Size: 1 KB

Versions: 79

Compression:

Stored size: 1 KB

Contents

require File.expand_path("../common", __FILE__)
require "gem_publisher/git_remote"

module GemPublisher
  class GitRemoteTest < MiniTest::Unit::TestCase
    def test_should_list_remote_tags
      cli_facade = mock
      cli_facade.stubs(:execute).
        with("git", "ls-remote", "--tags", "origin").
        returns(data_file("tags"))

      remote = GitRemote.new("origin", cli_facade)
      expected = %w[v0.0.10 v0.0.11 v0.0.6 v0.0.7 v0.0.9]
      assert_equal expected.sort, remote.tags.sort
    end

    def test_should_push_tag_to_remote
      cli_facade = mock
      sha1 = "5294fac0c70956209494b69bc1a8c38192f6a931"
      cli_facade.stubs(:execute).
        with("git", "rev-parse", "HEAD").
        returns("#{sha1}\n")
      cli_facade.expects(:execute).
        with("git", "update-ref", "refs/tags/nameoftag", sha1)
      cli_facade.expects(:execute).
        with("git", "push", "origin", "tag", "nameoftag")

      remote = GitRemote.new("origin", cli_facade)
      remote.add_tag("nameoftag")
    end
  end
end

Version data entries

79 entries across 75 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/gem_publisher-1.5.0/test/git_remote_test.rb