File: help_spec.rb

package info (click to toggle)
yard 0.9.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,720 kB
  • sloc: ruby: 31,354; javascript: 7,608; makefile: 21
file content (22 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

RSpec.describe YARD::CLI::Help do
  describe "#run" do
    it "accepts help command" do
      expect(CLI::Yardoc).to receive(:run).with('--help')
      CLI::Help.run('doc')
    end

    it "accepts no arguments (and lists all commands)" do
      expect(CLI::CommandParser).to receive(:run).with('--help')
      CLI::Help.run
    end

    it "shows all commands if command isn't found" do
      expect(CLI::CommandParser).to receive(:run).with('--help')
      help = CLI::Help.new
      expect(log).to receive(:puts).with(/not found/)
      help.run('unknown')
    end
  end
end