Sha256: 9fe1538083a20b4fc7758eb7527848cdffd472c20d1b162b731a834585e18d50

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 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\ndependencies_file_dir: './doc/'\nproject_name: # project name\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

1 entries across 1 versions & 1 rubygems

Version Path
license_finder-1.0.0.1 features/step_definitions/cli_steps.rb