Add puppetlabs/certregen module
[mirror/dsa-puppet.git] / 3rdparty / modules / certregen / spec / acceptance / help_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe "pupper help certregen" do
4   # NOTE: MODULES-4733 certregen is not currently compatible with ruby < 1.9
5   ruby_ver = 0
6   on(default, 'ruby --version') do |result|
7     m = /\d+\.\d+\.\d+/.match(result.stdout)
8     ruby_ver = m[0] if m
9   end
10   unless version_is_less(ruby_ver, '1.9') then
11     describe "C98923 - Verify that 'puppet certregen --help' prints help text" do
12       # NOTE: `--help` only works on puppet version 4+
13       if version_is_less( '3.9.9', on(default, puppet('--version')).stdout)
14         describe command("puppet certregen --help") do
15           its(:stdout) { should match( /.*USAGE: puppet certregen <action>.*/ ) }
16           its(:stdout) { should match( /.*See 'puppet man certregen' or 'man puppet-certregen' for full help.*/ ) }
17         end
18       end
19     end
20     describe "C99812 - Verify that 'puppet help certregen' prints help text" do
21         describe command("puppet help certregen") do
22           its(:stdout) { should match( /.*USAGE: puppet certregen <action>.*/ ) }
23           its(:stdout) { should match( /.*See 'puppet man certregen' or 'man puppet-certregen' for full help.*/ ) }
24         end
25     end
26     describe "C99813 - Verify that 'puppet help certregen healthcheck' prints help text for healthcheck subcommand" do
27         describe command("puppet help certregen healthcheck") do
28           its(:stdout) { should match( /.*USAGE: puppet certregen healthcheck .*/ ) }
29           its(:stdout) { should match( /.*See 'puppet man certregen' or 'man puppet-certregen' for full help.*/ ) }
30         end
31     end
32     describe "C99814 - Verify that 'puppet help certregen ca' prints help text for ca subcommand" do
33         describe command("puppet help certregen ca") do
34           its(:stdout) { should match( /.*USAGE: puppet certregen ca .*/ ) }
35           its(:stdout) { should match( /.*See 'puppet man certregen' or 'man puppet-certregen' for full help.*/ ) }
36         end
37     end
38   end
39 end