Sha256: b7ac577409318fe201a30c8fa7cd48fcf69d43cf6d78a3215167c86eeb1a2c20

Contents?: true

Size: 848 Bytes

Versions: 4

Compression:

Stored size: 848 Bytes

Contents

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

module GemPublisher
  class IntegrationTest < MiniTest::Unit::TestCase
    def setup
      Open3.stubs(:capture3)
    end

    def expect_cli(command, response = "")
      Open3.expects(:capture3).
        with(command).
        returns([response, "", stub(exitstatus: 0)])
    end

    def test_should_build_and_tag_and_publish
      gemspec = data_file_path("example.gemspec")
      expect_cli "git ls-remote --tags origin", data_file("tags")
      expect_cli "gem build #{gemspec}", data_file("gem_build")
      expect_cli "gem push example-0.0.3.gem"
      expect_cli "git rev-parse HEAD", "1234abcd"
      expect_cli "git update-ref refs/tags/v0.0.3 1234abcd"
      expect_cli "git push origin tag v0.0.3"
      GemPublisher.publish_if_updated gemspec
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gem_publisher-1.1.1 test/integration_test.rb
gem_publisher-1.1.0 test/integration_test.rb
gem_publisher-1.0.0 test/integration_test.rb
gem_publisher-0.0.4 test/integration_test.rb