|
17 | 17 |
|
18 | 18 | step "Try to install a non-existent module" |
19 | 19 | on master, puppet("module install #{module_author}-#{module_name}"), :acceptable_exit_codes => [1] do |
20 | | - assert_match(/#{module_author}\/#{module_name} not found/, stderr, |
21 | | - "Error that module was not found was not displayed") |
| 20 | + assert_match(/could not install '#{module_author}-#{module_name}'/i, stderr, |
| 21 | + "Error that module could not be installed was not displayed") |
| 22 | + |
| 23 | + assert_match(/no releases are available from/i, stderr, |
| 24 | + "Error that no releases were found was not displayed") |
22 | 25 | end |
23 | 26 |
|
24 | 27 | step "Try to install a non-existent module (JSON rendering)" |
|
27 | 30 | str = stdout.lines.to_a.last |
28 | 31 | json = JSON.parse(str) |
29 | 32 |
|
30 | | - oneline_expectation = %[Could not execute operation for '#{module_author}/#{module_name}'. Detail: Module #{module_author}/#{module_name} not found / 410 Gone.] |
31 | | - multiline_expectation = <<-OUTPUT.chomp |
32 | | -Could not execute operation for '#{module_author}/#{module_name}' |
33 | | - The server being queried was https://forge.puppetlabs.com |
34 | | - The HTTP response we received was '410 Gone' |
35 | | - The message we received said 'Module #{module_author}/#{module_name} not found' |
36 | | - Check the author and module names are correct. |
37 | | -OUTPUT |
38 | | - |
| 33 | + oneline_expectation = /could not install '#{module_author}-#{module_name}'; no releases are available from/i |
| 34 | + multiline_expectation = /could not install '#{module_author}-#{module_name}'.*no releases are available from.*have at least one published release.*\z/im |
39 | 35 |
|
40 | | - assert_equal nil, json['module_version'] |
| 36 | + assert_equal 'failure', json['result'] |
41 | 37 | assert_equal "#{module_author}-#{module_name}", json['module_name'] |
42 | | - assert_equal 'failure', json['result'] |
43 | | - assert_equal master['distmoduledir'], json['install_dir'] |
44 | | - assert_equal multiline_expectation, json['error']['multiline'] |
45 | | - assert_equal oneline_expectation, json['error']['oneline'] |
| 38 | + assert_equal '>= 0.0.0', json['module_version'] |
| 39 | + assert_equal master['distmoduledir'], json['install_dir'] |
| 40 | + assert_match oneline_expectation, json['error']['oneline'] |
| 41 | + assert_match multiline_expectation, json['error']['multiline'] |
46 | 42 | end |
47 | | - |
0 commit comments