Sha256: e56491913f31855abfbc61cfcc153ebc6aaf36866c71b0c8304dc44e8eb9edbf

Contents?: true

Size: 1.67 KB

Versions: 13

Compression:

Stored size: 1.67 KB

Contents

require_relative '../../support/feature_helper'

describe "License Finder command line executable" do
  # As a developer
  # I want a command-line interface
  # So that I can manage my application's dependencies and licenses

  let(:developer) { LicenseFinder::TestingDSL::User.new }

  specify "shows usage and subcommand help" do
    developer.create_empty_project

    developer.execute_command "license_finder help"
    expect(developer).to be_seeing 'license_finder help [COMMAND]'

    developer.execute_command "license_finder ignored_groups help add"
    expect(developer).to be_seeing 'license_finder ignored_groups add GROUP'
  end

  it "reports `license_finder`'s license is MIT" do
    developer.create_ruby_app # has license_finder as a dependency

    developer.run_license_finder
    expect(developer).to be_seeing_something_like /license_finder.*MIT/
  end

  it "reports dependencies' licenses" do
    developer.create_ruby_app # has license_finder as a dependency, which has thor as a dependency

    developer.run_license_finder
    expect(developer).to be_seeing_something_like /thor.*MIT/
  end

  specify "runs default command" do
    developer.create_empty_project

    developer.run_license_finder
    expect(developer).to be_receiving_exit_code(0)
    expect(developer).to be_seeing 'All dependencies are approved for use'
  end

  specify "displays an error if project_path does not exist" do
    developer.create_empty_project

    developer.execute_command('license_finder report --project-path=/path/that/does/not/exist')
    expect(developer).to be_seeing("Project path '/path/that/does/not/exist' does not exist!")
    expect(developer).to be_receiving_exit_code(1)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
license_finder-3.0.0 features/features/cli/cli_spec.rb
license_finder-2.1.2 features/features/cli/cli_spec.rb
license_finder-2.1.1 features/features/cli/cli_spec.rb
license_finder-2.1.0 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc9 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc8 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc7 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc6 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc5 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc4 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc3 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc2 features/features/cli/cli_spec.rb
license_finder-2.1.0.rc1 features/features/cli/cli_spec.rb