Sha256: 4fa24649e26f91907de61d1d07c3f1f787d9ca94e39c27b85faca44e65a4acac

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

require(File.expand_path('_lib', File.dirname(__FILE__)))

class StartupTest < EinhornIntegrationTestCase
  include Helpers::EinhornHelpers

  describe 'when invoked without args' do
    it 'prints usage and exits with 1' do
      assert_raises(Subprocess::NonZeroExit) do
        Subprocess.check_call(default_einhorn_command,
                              :stdout => Subprocess::PIPE,
                              :stderr => Subprocess::PIPE) do |einhorn|
          stdout, stderr = einhorn.communicate
          assert_match(/\A## Usage/, stdout)
          assert_equal(1, einhorn.wait.exitstatus)
        end
      end
    end
  end

  describe 'when invoked with --upgrade-check' do
    it 'successfully exits' do
      Subprocess.check_call(default_einhorn_command + %w[--upgrade-check],
                            :stdout => Subprocess::PIPE,
                            :stderr => Subprocess::PIPE) do |einhorn|
        stdout, stderr = einhorn.communicate
        status = einhorn.wait
        assert_equal(0, status.exitstatus)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
einhorn-0.8.2 test/integration/startup.rb
einhorn-0.7.4 test/integration/startup.rb
einhorn-0.7.3 test/integration/startup.rb
einhorn-0.7.2 test/integration/startup.rb
einhorn-0.7.1 test/integration/startup.rb
einhorn-0.7.0 test/integration/startup.rb
einhorn-0.6.5 test/integration/startup.rb
einhorn-0.6.4 test/integration/startup.rb
einhorn-0.6.3 test/integration/startup.rb
einhorn-0.6.2 test/integration/startup.rb
einhorn-0.6.1 test/integration/startup.rb
einhorn-0.6.0 test/integration/startup.rb