~ubuntu-branches/ubuntu/wily/ruby-cri/wily

« back to all changes in this revision

Viewing changes to test/test_basic_root.rb

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2015-05-25 00:48:53 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20150525004853-vthmf7zp9j74ahry
Tags: 2.7.0-1
* Imported Upstream version 2.7.0
* refresh privacy-breach.patch
* bump Standards-Version to 3.9.6 (no changes needed)
* use the rake method to run the tests
* invoke directly yard instead of using upstream Rakefile to build the
  documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# encoding: utf-8
2
2
 
3
 
class Cri::BasicRootTestCase < Cri::TestCase
4
 
 
5
 
  def test_run_with_help
6
 
    cmd = Cri::Command.new_basic_root
7
 
 
8
 
    stdout, stderr = capture_io_while do
9
 
      assert_raises SystemExit do
10
 
        cmd.run(%w( -h ))
 
3
module Cri
 
4
  class BasicRootTestCase < Cri::TestCase
 
5
    def test_run_with_help
 
6
      cmd = Cri::Command.new_basic_root
 
7
 
 
8
      stdout, _stderr = capture_io_while do
 
9
        assert_raises SystemExit do
 
10
          cmd.run(%w( -h ))
 
11
        end
11
12
      end
 
13
 
 
14
      assert stdout =~ /COMMANDS.*\n.*help.*show help/
12
15
    end
13
 
 
14
 
    assert stdout =~ /COMMANDS.*\n.*help.*show help/
15
16
  end
16
 
 
17
17
end