Sha256: dcf5037012efdb2403124b8dc43f12a81bda111934c8ceb3a0fc377bb3a97d10

Contents?: true

Size: 958 Bytes

Versions: 5

Compression:

Stored size: 958 Bytes

Contents

require "test_helper"

describe "bin/vanity" do
  before do
    not_collecting!
  end

  it "responds to version" do
    assert_output(nil) do
      proc {
        ARGV.clear
        ARGV << '--version'
        load "bin/vanity"
      }.must_raise SystemExit
    end
  end

  it "responds to help" do
    assert_output(nil) do
      proc {
        ARGV.clear
        ARGV << '--help'
        load "bin/vanity"
      }.must_raise SystemExit
    end
  end

  it "responds to list" do
    require "vanity/commands/list"
    Vanity::Commands.expects(:list)
    ARGV.clear
    ARGV << 'list'
    load "bin/vanity"
  end

  it "responds to report" do
    require "vanity/commands/report"
    Vanity::Commands.expects(:report)
    ARGV.clear
    ARGV << 'report'
    load "bin/vanity"
  end

  it "responds to unknown commands" do
    assert_output("No such command: upgrade\n") do
      ARGV.clear
      ARGV << 'upgrade'
      load "bin/vanity"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vanity-4.0.4 test/cli_test.rb
vanity-4.0.3 test/cli_test.rb
vanity-4.0.2 test/cli_test.rb
vanity-4.0.1 test/cli_test.rb
vanity-4.0.0 test/cli_test.rb