expect_warn_and_puts

in spec/lib/gdk/command/cleanup_spec.rb [141:160]


    def expect_warn_and_puts(show_uninstall_software: true)
      expect(GDK::Output).to receive(:warn).with('About to perform the following actions:').ordered
      expect(GDK::Output).to receive(:puts).with(stderr: true).ordered
      expect_truncate_puts

      if show_uninstall_software
        expect(GDK::Output).to receive(:puts).with(
          '- Uninstall any asdf software that is not defined in .tool-versions:', stderr: true
        ).ordered
        software_to_uninstall.sort_by { |n, _| n }.each do |name, versions|
          expect(GDK::Output).to receive(:puts).with("#{name} #{versions.keys.join(' ')}").ordered
        end
        expect(GDK::Output).to receive(:puts).with(stderr: true).ordered
        expect(GDK::Output).to receive(:puts)
          .with('Run `GDK_CLEANUP_SOFTWARE=false gdk cleanup` to skip uninstalling software.').ordered
      end

      expect(GDK::Output).to receive(:puts).with(stderr: true).at_least(:once).ordered
    end