Sha256: 7bf3e95ab8afaf4300b3cbdfb6bc52fb12fb5900d85cf4a1a4dc0507a3b876e5

Contents?: true

Size: 1.9 KB

Versions: 16

Compression:

Stored size: 1.9 KB

Contents

require "spec_helper"
require "capistrano/doctor/gems_doctor"
require "airbrussh/version"
require "sshkit/version"
require "net/ssh/version"

module Capistrano
  module Doctor
    describe GemsDoctor do
      let(:doc) { GemsDoctor.new }

      it "prints using 4-space indentation" do
        expect { doc.call }.to output(/^ {4}/).to_stdout
      end

      it "prints the Capistrano version" do
        expect { doc.call }.to\
          output(/capistrano\s+#{Regexp.quote(Capistrano::VERSION)}/).to_stdout
      end

      it "prints the Rake version" do
        expect { doc.call }.to\
          output(/rake\s+#{Regexp.quote(Rake::VERSION)}/).to_stdout
      end

      it "prints the SSHKit version" do
        expect { doc.call }.to\
          output(/sshkit\s+#{Regexp.quote(SSHKit::VERSION)}/).to_stdout
      end

      it "prints the Airbrussh version" do
        expect { doc.call }.to\
          output(/airbrussh\s+#{Regexp.quote(Airbrussh::VERSION)}/).to_stdout
      end

      it "prints the net-ssh version" do
        expect { doc.call }.to\
          output(/net-ssh\s+#{Regexp.quote(Net::SSH::Version::STRING)}/).to_stdout
      end

      it "warns that new version is available" do
        Gem.stubs(:latest_version_for).returns(Gem::Version.new("99.0.0"))
        expect { doc.call }.to output(/\(update available\)/).to_stdout
      end

      describe "Rake" do
        before do
          load File.expand_path("../../../../../lib/capistrano/doctor.rb",
                                __FILE__)
        end

        after do
          Rake::Task.clear
        end

        it "has an doctor:gems task that calls GemsDoctor" do
          GemsDoctor.any_instance.expects(:call)
          Rake::Task["doctor:gems"].invoke
        end

        it "has a doctor task that depends on doctor:gems" do
          expect(Rake::Task["doctor"].prerequisites).to include("doctor:gems")
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/capistrano-3.11.0/spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.11.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.10.2 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.10.1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.10.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.9.1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.9.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.8.2 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.8.1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.8.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.7.2 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.7.1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.7.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.7.0.beta1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.6.1 spec/lib/capistrano/doctor/gems_doctor_spec.rb
capistrano-3.6.0 spec/lib/capistrano/doctor/gems_doctor_spec.rb