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
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-codec-json-2.0.3 vendor/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/gem_publisher-1.5.0/test/git_remote_test.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/gem_publisher-1.5.0/test/git_remote_test.rb
gem_publisher-1.5.0 test/git_remote_test.rb
gem_publisher-1.4.2 test/git_remote_test.rb
gem_publisher-1.4.1 test/git_remote_test.rb
gem_publisher-1.4.0 test/git_remote_test.rb
gem_publisher-1.3.2 test/git_remote_test.rb
gem_publisher-1.3.1 test/git_remote_test.rb
gem_publisher-1.3.0 test/git_remote_test.rb
gem_publisher-1.2.0 test/git_remote_test.rb
gem_publisher-1.1.1 test/git_remote_test.rb
gem_publisher-1.1.0 test/git_remote_test.rb
gem_publisher-1.0.0 test/git_remote_test.rb
gem_publisher-0.0.4 test/git_remote_test.rb
gem_publisher-0.0.3 test/git_remote_test.rb