Files
chromebrew/tests/commands/help.rb
SupeChicken666 91f0f2ac98 lib/package: Get rid of eval strings (#10117)
* lib/package: Cleanup functions, get rid of `eval` strings

Signed-off-by: supechicken <me@supechicken666.dev>

* Fix error

Signed-off-by: supechicken <me@supechicken666.dev>

* Fix error

Signed-off-by: supechicken <me@supechicken666.dev>

* Add comments

Signed-off-by: supechicken <me@supechicken666.dev>

* Make rubocop happy

Signed-off-by: supechicken <me@supechicken666.dev>

* Fix error

Signed-off-by: supechicken <me@supechicken666.dev>

* Simplify

Signed-off-by: supechicken <me@supechicken666.dev>

* Bump crew version

Signed-off-by: supechicken <me@supechicken666.dev>

---------

Signed-off-by: supechicken <me@supechicken666.dev>
2024-07-10 14:49:10 -05:00

38 lines
978 B
Ruby

require 'minitest/autorun'
require_relative '../../commands/help'
require_relative '../../lib/package'
class HelpCommandTest < Minitest::Test
def test_no_arguments
expected_output = <<~EOT
Usage: crew help <command>
Available commands: #{CREW_COMMANDS}
EOT
assert_output expected_output, nil do
Command.help(nil)
end
end
def test_prop_command
expected_output = <<~EOT
Explain the purpose of various package boolean properties.
Usage: crew prop <property>
Available properties: #{Package.available_boolean_properties.join(', ')}
EOT
assert_output expected_output, nil do
Command.help('prop')
end
end
def test_const_command
expected_output = <<~EOT
Display constant(s).
Usage: crew const [<const1> <const2> ...]
If no constants are provided, all constants will be displayed.
EOT
assert_output expected_output, nil do
Command.help('const')
end
end
end