Skip to content

Commit

Permalink
update error message about wrong product identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
thutterer committed Jan 11, 2017
1 parent 4b2a4b8 commit e61f1da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/suse/connect/cli.rb
Expand Up @@ -101,8 +101,8 @@ def extract_options # rubocop:disable MethodLength
check_if_param(opt, 'Please provide a product identifier')
# rubocop:disable RegexpLiteral
check_if_param((opt =~ /\S+\/\S+\/\S+/), 'Please provide the product identifier in this format: ' \
'<internal name>/<version>/<architecture>. For installed products you can find these values by calling: ' \
'\'zypper products\'. ')
'<internal name>/<version>/<architecture>. You can find these values by calling: ' \
'\'SUSEConnect --list-extensions\'. ')
identifier, version, arch = opt.split('/')
@options[:product] = Remote::Product.new(identifier: identifier, version: version, arch: arch)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/connect/cli_spec.rb
Expand Up @@ -331,8 +331,8 @@
end

describe 'errors on invalid options format' do
it 'error on invalid product options format' do
expect(string_logger).to receive(:error).with(/Please provide the product identifier in this format/)
it 'error on invalid product options format with hint where to find correct product identifiers' do
expect(string_logger).to receive(:error).with(/Please provide the product identifier in this format.*SUSEConnect --list-extensions/)
argv = %w{--product sles}
subject.new(argv)
end
Expand Down

0 comments on commit e61f1da

Please sign in to comment.