0.0
No commit activity in last 3 years
No release in over 3 years
Extends Shoulda or Test::Unit with macros for testing command line apps
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

cmd_line_test - Extends Shoulda or Test::Unit with macros for testing command line apps¶ ↑

Basic Usage¶ ↑

Installation¶ ↑

$ gem install cmd_line_test

Example¶ ↑

If you are about to start writing new command line utility MyCommandLineApp, you probably want to specify its options and behavior, likely in form of tests. This gem is aimed to simplify creation of such tests:

requrie 'cmd_line_test'

class CliTest < Test::Unit::TestCase
  run_command_line_as {MyCommandLineApp.run}

  run_with_argv "--help" do
    assert_successful_run
    assert_out_contains /Usage:/
  end
end

Shortcomings¶ ↑

Only tested on the 1.8.7 Ruby implementation and with Shoulda 2.10.1

License¶ ↑

cmd_line_test is released under the MIT license.