Sha256: 3efec9d86cc38c49b1959fa78273e4d9fa6e7d5da802102c75bd08013cadcb93

Contents?: true

Size: 1.75 KB

Versions: 3

Compression:

Stored size: 1.75 KB

Contents

Given(/^I have an app that has no config directory$/) do
  @user = ::DSL::User.new
  @user.create_ruby_app
  path = @user.config_path
  path.rmtree if path.exist?
  path.should_not be_exist
end

Given(/^I have an app with an unapproved dependency$/) do
  @user = ::DSL::User.new
  @user.create_ruby_app
  @user.create_and_depend_on_gem 'unapproved_gem', license: 'MIT'
end

When(/^I run license_finder help on a specific command$/) do
  @user.execute_command "license_finder ignored_bundler_groups help add"
end

When(/^I run license_finder help$/) do
  @user.execute_command "license_finder help"
end

Then(/^it creates a config directory with the license_finder config$/) do
  @user.config_path.should be_exist
  text = %|---\nwhitelist:\n#- MIT\n#- Apache 2.0\nignore_groups:\n#- test\n#- development\nignore_dependencies:\n#- bundler\ndependencies_file_dir: './doc/'\nproject_name: # project name\ngradle_command: # only meaningful if used with a Java/gradle project. Defaults to "gradle".\n|
  @user.config_file.read.should == text.gsub(/^\s+/, "")
end

Then /^it should exit with status code (\d)$/ do |status|
  $?.exitstatus.should == status.to_i
end

Then(/^should list my unapproved dependency in the output$/) do
  @user.should be_seeing 'unapproved_gem'
end

Then(/^I should see all dependencies approved for use$/) do
  @user.should be_seeing 'All dependencies are approved for use'
end

Then(/^I should see the correct subcommand usage instructions$/) do
  @user.should be_seeing 'license_finder ignored_bundler_groups add GROUP'
end

Then(/^I should see the default usage instructions$/) do
  @user.should be_seeing 'license_finder help [COMMAND]'
end

Then(/^I should see License Finder has the MIT license$/) do
  @user.should be_seeing_something_like /license_finder.*MIT/
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
license_finder-1.1.1-java features/step_definitions/cli_steps.rb
license_finder-1.1.1 features/step_definitions/cli_steps.rb
license_finder-1.1.0 features/step_definitions/cli_steps.rb