Sha256: ce8c4c1d72bf1faee00662f5e3e39c06a58aaf4d48f3ded71a12a1b311a34ef6

Contents?: true

Size: 950 Bytes

Versions: 2

Compression:

Stored size: 950 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')

describe ::Inch::CLI::CommandParser do
  before do
    Dir.chdir fixture_path(:simple)
    @command = ::Inch::CLI::CommandParser
  end

  it "should run without args" do
    out, err = capture_io do
      @command.run()
    end
    refute out.empty?, "there should be some output"
    assert err.empty?, "there should be no errors"
  end

  it "should run Command::Suggest with filelist in args" do
    out, err = capture_io do
      @command.run("suggest", "lib/**/*.rb", "app/**/*.rb")
    end
    refute out.empty?, "there should be some output"
    assert err.empty?, "there should be no errors"
  end

  it "should output info when run with --help" do
    out, err = capture_io do
      @command.run("--help")
    end
    refute out.empty?, "there should be some output"
    assert_match /\bUsage\b.+inch/, out
    assert err.empty?, "there should be no errors"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inch-0.1.1 test/inch/cli/command_parser_test.rb
inch-0.1.0 test/inch/cli/command_parser_test.rb