puppet 7.21.0-x86-mingw32 → 7.22.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +48 -34
  3. data/Guardfile.example +1 -1
  4. data/ext/project_data.yaml +1 -1
  5. data/ext/windows/service/daemon.rb +1 -1
  6. data/lib/puppet/indirector/facts/facter.rb +4 -1
  7. data/lib/puppet/version.rb +1 -1
  8. data/man/man5/puppet.conf.5 +2 -2
  9. data/man/man8/puppet-agent.8 +1 -1
  10. data/man/man8/puppet-apply.8 +1 -1
  11. data/man/man8/puppet-catalog.8 +1 -1
  12. data/man/man8/puppet-config.8 +1 -1
  13. data/man/man8/puppet-describe.8 +1 -1
  14. data/man/man8/puppet-device.8 +1 -1
  15. data/man/man8/puppet-doc.8 +1 -1
  16. data/man/man8/puppet-epp.8 +1 -1
  17. data/man/man8/puppet-facts.8 +1 -1
  18. data/man/man8/puppet-filebucket.8 +1 -1
  19. data/man/man8/puppet-generate.8 +1 -1
  20. data/man/man8/puppet-help.8 +1 -1
  21. data/man/man8/puppet-lookup.8 +1 -1
  22. data/man/man8/puppet-module.8 +1 -1
  23. data/man/man8/puppet-node.8 +1 -1
  24. data/man/man8/puppet-parser.8 +1 -1
  25. data/man/man8/puppet-plugin.8 +1 -1
  26. data/man/man8/puppet-report.8 +1 -1
  27. data/man/man8/puppet-resource.8 +1 -1
  28. data/man/man8/puppet-script.8 +1 -1
  29. data/man/man8/puppet-ssl.8 +1 -1
  30. data/man/man8/puppet.8 +2 -2
  31. data/spec/integration/application/agent_spec.rb +1 -1
  32. data/spec/unit/application/agent_spec.rb +1 -1
  33. data/spec/unit/application/device_spec.rb +1 -1
  34. data/spec/unit/application/resource_spec.rb +1 -1
  35. data/spec/unit/daemon_spec.rb +1 -1
  36. data/spec/unit/file_bucket/dipper_spec.rb +1 -1
  37. data/spec/unit/file_serving/fileset_spec.rb +14 -14
  38. data/spec/unit/file_system_spec.rb +3 -1
  39. data/spec/unit/graph/simple_graph_spec.rb +1 -1
  40. data/spec/unit/indirector/facts/facter_spec.rb +18 -3
  41. data/spec/unit/indirector/file_server_spec.rb +5 -5
  42. data/spec/unit/indirector/node/plain_spec.rb +1 -1
  43. data/spec/unit/provider/file/posix_spec.rb +4 -4
  44. data/spec/unit/provider/ldap_spec.rb +1 -1
  45. data/spec/unit/provider/nameservice_spec.rb +15 -15
  46. data/spec/unit/provider/package/aix_spec.rb +1 -1
  47. data/spec/unit/provider/package/nim_spec.rb +2 -2
  48. data/spec/unit/provider/service/bsd_spec.rb +4 -4
  49. data/spec/unit/provider/service/debian_spec.rb +2 -2
  50. data/spec/unit/provider/service/gentoo_spec.rb +20 -20
  51. data/spec/unit/provider/service/openbsd_spec.rb +18 -18
  52. data/spec/unit/provider/service/openrc_spec.rb +19 -19
  53. data/spec/unit/provider/service/systemd_spec.rb +22 -22
  54. data/spec/unit/provider/service/upstart_spec.rb +6 -6
  55. data/spec/unit/provider/user/aix_spec.rb +1 -1
  56. data/spec/unit/provider/user/hpux_spec.rb +1 -1
  57. data/spec/unit/provider/user/openbsd_spec.rb +1 -1
  58. data/spec/unit/provider/user/useradd_spec.rb +1 -1
  59. data/spec/unit/resource/type_spec.rb +2 -2
  60. data/spec/unit/ssl/base_spec.rb +1 -1
  61. data/spec/unit/ssl/certificate_request_spec.rb +1 -1
  62. data/spec/unit/ssl/certificate_spec.rb +1 -1
  63. data/spec/unit/transaction/event_manager_spec.rb +2 -2
  64. data/spec/unit/type/exec_spec.rb +1 -1
  65. data/spec/unit/util/backups_spec.rb +1 -1
  66. data/spec/unit/util/filetype_spec.rb +3 -3
  67. data/spec/unit/util/resource_template_spec.rb +1 -1
  68. metadata +9 -3
@@ -28,7 +28,7 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
28
28
  context "#start" do
29
29
  it "should use the supplied start command if specified" do
30
30
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :start => '/bin/foo'))
31
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
31
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
32
32
  provider.start
33
33
  end
34
34
 
@@ -42,7 +42,7 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
42
42
  context "#stop" do
43
43
  it "should use the supplied stop command if specified" do
44
44
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :stop => '/bin/foo'))
45
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
45
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
46
46
  provider.stop
47
47
  end
48
48
 
@@ -56,27 +56,27 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
56
56
  context "#status" do
57
57
  it "should use the status command from the resource" do
58
58
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
59
- expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
59
+ expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
60
60
  expect(provider).to receive(:execute)
61
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
61
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
62
62
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
63
63
  provider.status
64
64
  end
65
65
 
66
66
  it "should return :stopped when status command returns with a non-zero exitcode" do
67
67
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
68
- expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
68
+ expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
69
69
  expect(provider).to receive(:execute)
70
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
70
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
71
71
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 3))
72
72
  expect(provider.status).to eq(:stopped)
73
73
  end
74
74
 
75
75
  it "should return :running when status command returns with a zero exitcode" do
76
76
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
77
- expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
77
+ expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', :get, 'sshd', :status], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
78
78
  expect(provider).to receive(:execute)
79
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
79
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
80
80
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
81
81
  expect(provider.status).to eq(:running)
82
82
  end
@@ -85,9 +85,9 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
85
85
  context "#restart" do
86
86
  it "should use the supplied restart command if specified" do
87
87
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :restart => '/bin/foo'))
88
- expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', '-f', :restart, 'sshd'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
88
+ expect(provider).not_to receive(:execute).with(['/usr/sbin/rcctl', '-f', :restart, 'sshd'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
89
89
  expect(provider).to receive(:execute)
90
- .with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
90
+ .with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
91
91
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
92
92
  provider.restart
93
93
  end
@@ -110,13 +110,13 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
110
110
  context "#enabled?" do
111
111
  it "should return :true if the service is enabled" do
112
112
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
113
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'status'], :failonfail => false, :combine => false, :squelch => false).and_return(double(:exitstatus => 0))
113
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'status'], {:failonfail => false, :combine => false, :squelch => false}).and_return(double(:exitstatus => 0))
114
114
  expect(provider.enabled?).to eq(:true)
115
115
  end
116
116
 
117
117
  it "should return :false if the service is disabled" do
118
118
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
119
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'status'], :failonfail => false, :combine => false, :squelch => false).and_return(Puppet::Util::Execution::ProcessOutput.new('NO', 1))
119
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'status'], {:failonfail => false, :combine => false, :squelch => false}).and_return(Puppet::Util::Execution::ProcessOutput.new('NO', 1))
120
120
  expect(provider.enabled?).to eq(:false)
121
121
  end
122
122
  end
@@ -147,19 +147,19 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
147
147
  context "#running?" do
148
148
  it "should run rcctl check to check the service" do
149
149
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
150
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], :failonfail => false, :combine => false, :squelch => false).and_return('sshd(ok)')
150
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], {:failonfail => false, :combine => false, :squelch => false}).and_return('sshd(ok)')
151
151
  expect(provider.running?).to be_truthy
152
152
  end
153
153
 
154
154
  it "should return true if the service is running" do
155
155
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
156
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], :failonfail => false, :combine => false, :squelch => false).and_return('sshd(ok)')
156
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], {:failonfail => false, :combine => false, :squelch => false}).and_return('sshd(ok)')
157
157
  expect(provider.running?).to be_truthy
158
158
  end
159
159
 
160
160
  it "should return nil if the service is not running" do
161
161
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
162
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], :failonfail => false, :combine => false, :squelch => false).and_return('sshd(failed)')
162
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'check', 'sshd'], {:failonfail => false, :combine => false, :squelch => false}).and_return('sshd(failed)')
163
163
  expect(provider.running?).to be_nil
164
164
  end
165
165
  end
@@ -167,19 +167,19 @@ describe 'Puppet::Type::Service::Provider::Openbsd',
167
167
  context "#flags" do
168
168
  it "should return flags when set" do
169
169
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :flags => '-6'))
170
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'flags'], :failonfail => false, :combine => false, :squelch => false).and_return('-6')
170
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'flags'], {:failonfail => false, :combine => false, :squelch => false}).and_return('-6')
171
171
  provider.flags
172
172
  end
173
173
 
174
174
  it "should return empty flags" do
175
175
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
176
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'flags'], :failonfail => false, :combine => false, :squelch => false).and_return('')
176
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'sshd', 'flags'], {:failonfail => false, :combine => false, :squelch => false}).and_return('')
177
177
  provider.flags
178
178
  end
179
179
 
180
180
  it "should return flags for special services" do
181
181
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'pf'))
182
- expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'pf', 'flags'], :failonfail => false, :combine => false, :squelch => false).and_return('YES')
182
+ expect(provider).to receive(:execute).with(['/usr/sbin/rcctl', 'get', 'pf', 'flags'], {:failonfail => false, :combine => false, :squelch => false}).and_return('YES')
183
183
  provider.flags
184
184
  end
185
185
  end
@@ -37,13 +37,13 @@ describe 'Puppet::Type::Service::Provider::Openrc',
37
37
  describe "#start" do
38
38
  it "should use the supplied start command if specified" do
39
39
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :start => '/bin/foo'))
40
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
40
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
41
41
  provider.start
42
42
  end
43
43
 
44
44
  it "should start the service with rc-service start otherwise" do
45
45
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
46
- expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:start], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
46
+ expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:start], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
47
47
  provider.start
48
48
  end
49
49
  end
@@ -51,13 +51,13 @@ describe 'Puppet::Type::Service::Provider::Openrc',
51
51
  describe "#stop" do
52
52
  it "should use the supplied stop command if specified" do
53
53
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :stop => '/bin/foo'))
54
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
54
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
55
55
  provider.stop
56
56
  end
57
57
 
58
58
  it "should stop the service with rc-service stop otherwise" do
59
59
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd'))
60
- expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:stop], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
60
+ expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:stop], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
61
61
  provider.stop
62
62
  end
63
63
  end
@@ -147,25 +147,25 @@ describe 'Puppet::Type::Service::Provider::Openrc',
147
147
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
148
148
  expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
149
149
  expect(provider).to receive(:execute)
150
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
150
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
151
151
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
152
152
  provider.status
153
153
  end
154
154
 
155
155
  it "should return :stopped when status command returns with a non-zero exitcode" do
156
156
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
157
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
157
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
158
158
  expect(provider).to receive(:execute)
159
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
159
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
160
160
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 3))
161
161
  expect(provider.status).to eq(:stopped)
162
162
  end
163
163
 
164
164
  it "should return :running when status command returns with a zero exitcode" do
165
165
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :status => '/bin/foo'))
166
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
166
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
167
167
  expect(provider).to receive(:execute)
168
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
168
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
169
169
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
170
170
  expect(provider.status).to eq(:running)
171
171
  end
@@ -174,14 +174,14 @@ describe 'Puppet::Type::Service::Provider::Openrc',
174
174
  describe "when hasstatus is false" do
175
175
  it "should return running if a pid can be found" do
176
176
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasstatus => false))
177
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
177
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
178
178
  expect(provider).to receive(:getpid).and_return(1000)
179
179
  expect(provider.status).to eq(:running)
180
180
  end
181
181
 
182
182
  it "should return stopped if no pid can be found" do
183
183
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasstatus => false))
184
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
184
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
185
185
  expect(provider).to receive(:getpid).and_return(nil)
186
186
  expect(provider.status).to eq(:stopped)
187
187
  end
@@ -191,7 +191,7 @@ describe 'Puppet::Type::Service::Provider::Openrc',
191
191
  it "should return running if rc-service status exits with a zero exitcode" do
192
192
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasstatus => true))
193
193
  expect(provider).to receive(:execute)
194
- .with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
194
+ .with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
195
195
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 0))
196
196
  expect(provider.status).to eq(:running)
197
197
  end
@@ -199,7 +199,7 @@ describe 'Puppet::Type::Service::Provider::Openrc',
199
199
  it "should return stopped if rc-service status exits with a non-zero exitcode" do
200
200
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasstatus => true))
201
201
  expect(provider).to receive(:execute)
202
- .with(['/sbin/rc-service','sshd',:status], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
202
+ .with(['/sbin/rc-service','sshd',:status], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
203
203
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 3))
204
204
  expect(provider.status).to eq(:stopped)
205
205
  end
@@ -209,22 +209,22 @@ describe 'Puppet::Type::Service::Provider::Openrc',
209
209
  describe "#restart" do
210
210
  it "should use the supplied restart command if specified" do
211
211
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :restart => '/bin/foo'))
212
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:restart], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
213
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
212
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:restart], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
213
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
214
214
  provider.restart
215
215
  end
216
216
 
217
217
  it "should restart the service with rc-service restart if hasrestart is true" do
218
218
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasrestart => true))
219
- expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:restart], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
219
+ expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:restart], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
220
220
  provider.restart
221
221
  end
222
222
 
223
223
  it "should restart the service with rc-service stop/start if hasrestart is false" do
224
224
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :hasrestart => false))
225
- expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:restart], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
226
- expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:stop], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
227
- expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:start], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
225
+ expect(provider).not_to receive(:execute).with(['/sbin/rc-service','sshd',:restart], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
226
+ expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:stop], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
227
+ expect(provider).to receive(:execute).with(['/sbin/rc-service','sshd',:start], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
228
228
  provider.restart
229
229
  end
230
230
  end
@@ -217,7 +217,7 @@ describe 'Puppet::Type::Service::Provider::Systemd',
217
217
  it "should use the supplied start command if specified" do
218
218
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service', :start => '/bin/foo'))
219
219
  expect(provider).to receive(:daemon_reload?).and_return('no')
220
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
220
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
221
221
  provider.start
222
222
  end
223
223
 
@@ -249,13 +249,13 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
249
249
  describe "#stop" do
250
250
  it "should use the supplied stop command if specified" do
251
251
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service', :stop => '/bin/foo'))
252
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
252
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
253
253
  provider.stop
254
254
  end
255
255
 
256
256
  it "should stop the service with systemctl stop otherwise" do
257
257
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
258
- expect(provider).to receive(:execute).with(['/bin/systemctl','stop', '--', 'sshd.service'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
258
+ expect(provider).to receive(:execute).with(['/bin/systemctl','stop', '--', 'sshd.service'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
259
259
  provider.stop
260
260
  end
261
261
 
@@ -277,13 +277,13 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
277
277
  describe "#daemon_reload?" do
278
278
  it "should skip the systemctl daemon_reload if not required by the service" do
279
279
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
280
- expect(provider).to receive(:execute).with(['/bin/systemctl', 'show', '--property=NeedDaemonReload', '--', 'sshd.service'], :failonfail => false).and_return("no")
280
+ expect(provider).to receive(:execute).with(['/bin/systemctl', 'show', '--property=NeedDaemonReload', '--', 'sshd.service'], {:failonfail => false}).and_return("no")
281
281
  provider.daemon_reload?
282
282
  end
283
283
  it "should run a systemctl daemon_reload if the service has been modified" do
284
284
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
285
- expect(provider).to receive(:execute).with(['/bin/systemctl', 'show', '--property=NeedDaemonReload', '--', 'sshd.service'], :failonfail => false).and_return("yes")
286
- expect(provider).to receive(:execute).with(['/bin/systemctl', 'daemon-reload'], :failonfail => false)
285
+ expect(provider).to receive(:execute).with(['/bin/systemctl', 'show', '--property=NeedDaemonReload', '--', 'sshd.service'], {:failonfail => false}).and_return("yes")
286
+ expect(provider).to receive(:execute).with(['/bin/systemctl', 'daemon-reload'], {:failonfail => false})
287
287
  provider.daemon_reload?
288
288
  end
289
289
  end
@@ -291,51 +291,51 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
291
291
  describe "#enabled?" do
292
292
  it "should return :true if the service is enabled" do
293
293
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
294
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], :failonfail => false).
294
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], {:failonfail => false}).
295
295
  and_return(Puppet::Util::Execution::ProcessOutput.new("enabled\n", 0))
296
296
  expect(provider.enabled?).to eq(:true)
297
297
  end
298
298
 
299
299
  it "should return :true if the service is static" do
300
300
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
301
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled','--', 'sshd.service'], :failonfail => false).
301
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled','--', 'sshd.service'], {:failonfail => false}).
302
302
  and_return(Puppet::Util::Execution::ProcessOutput.new("static\n", 0))
303
303
  expect(provider.enabled?).to eq(:true)
304
304
  end
305
305
 
306
306
  it "should return :false if the service is disabled" do
307
307
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
308
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], :failonfail => false).
308
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], {:failonfail => false}).
309
309
  and_return(Puppet::Util::Execution::ProcessOutput.new("disabled\n", 1))
310
310
  expect(provider.enabled?).to eq(:false)
311
311
  end
312
312
 
313
313
  it "should return :false if the service is indirect" do
314
314
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
315
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], :failonfail => false).
315
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], {:failonfail => false}).
316
316
  and_return(Puppet::Util::Execution::ProcessOutput.new("indirect\n", 0))
317
317
  expect(provider.enabled?).to eq(:false)
318
318
  end
319
319
 
320
320
  it "should return :false if the service is masked and the resource is attempting to be disabled" do
321
321
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service', :enable => false))
322
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], :failonfail => false).
322
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], {:failonfail => false}).
323
323
  and_return(Puppet::Util::Execution::ProcessOutput.new("masked\n", 1))
324
324
  expect(provider.enabled?).to eq(:false)
325
325
  end
326
326
 
327
327
  it "should return :mask if the service is masked and the resource is attempting to be masked" do
328
328
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service', :enable => 'mask'))
329
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], :failonfail => false).
329
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'sshd.service'], {:failonfail => false}).
330
330
  and_return(Puppet::Util::Execution::ProcessOutput.new("masked\n", 1))
331
331
  expect(provider.enabled?).to eq(:mask)
332
332
  end
333
333
 
334
334
  it "should consider nonexistent services to be disabled" do
335
335
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'doesnotexist'))
336
- expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'doesnotexist'], :failonfail => false)
336
+ expect(provider).to receive(:execute).with(['/bin/systemctl','is-enabled', '--', 'doesnotexist'], {:failonfail => false})
337
337
  .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))
338
- expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], :failonfail => false)
338
+ expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail => false})
339
339
  .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))
340
340
 
341
341
  expect(provider.enabled?).to be(:false)
@@ -363,7 +363,7 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
363
363
  it "should run systemctl to disable and mask a service" do
364
364
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
365
365
  expect(provider).to receive(:execute).
366
- with(['/bin/systemctl','cat', '--', 'sshd.service'], :failonfail => false).
366
+ with(['/bin/systemctl','cat', '--', 'sshd.service'], {:failonfail => false}).
367
367
  and_return(Puppet::Util::Execution::ProcessOutput.new("# /lib/systemd/system/sshd.service\n...", 0))
368
368
  # :disable is the only call in the provider that uses a symbol instead of
369
369
  # a string.
@@ -376,7 +376,7 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
376
376
  it "masks a service that doesn't exist" do
377
377
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'doesnotexist.service'))
378
378
  expect(provider).to receive(:execute).
379
- with(['/bin/systemctl','cat', '--', 'doesnotexist.service'], :failonfail => false).
379
+ with(['/bin/systemctl','cat', '--', 'doesnotexist.service'], {:failonfail => false}).
380
380
  and_return(Puppet::Util::Execution::ProcessOutput.new("No files found for doesnotexist.service.\n", 1))
381
381
  expect(provider).to receive(:systemctl).with(:mask, '--', 'doesnotexist.service')
382
382
  provider.mask
@@ -389,7 +389,7 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
389
389
  it "should return running if the command returns 0" do
390
390
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
391
391
  expect(provider).to receive(:execute)
392
- .with(['/bin/systemctl','is-active', '--', 'sshd.service'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
392
+ .with(['/bin/systemctl','is-active', '--', 'sshd.service'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
393
393
  .and_return(Puppet::Util::Execution::ProcessOutput.new("active\n", 0))
394
394
  expect(provider.status).to eq(:running)
395
395
  end
@@ -398,7 +398,7 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
398
398
  it "should return stopped if the command returns something non-0" do
399
399
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
400
400
  expect(provider).to receive(:execute)
401
- .with(['/bin/systemctl','is-active', '--', 'sshd.service'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
401
+ .with(['/bin/systemctl','is-active', '--', 'sshd.service'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
402
402
  .and_return(Puppet::Util::Execution::ProcessOutput.new("inactive\n", ec))
403
403
  expect(provider.status).to eq(:stopped)
404
404
  end
@@ -407,7 +407,7 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
407
407
  it "should use the supplied status command if specified" do
408
408
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service', :status => '/bin/foo'))
409
409
  expect(provider).to receive(:execute)
410
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
410
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
411
411
  .and_return(process_output)
412
412
  provider.status
413
413
  end
@@ -419,15 +419,15 @@ Jun 14 21:43:23 foo.example.com systemd[1]: sshd.service lacks both ExecStart= a
419
419
  it "should use the supplied restart command if specified" do
420
420
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd', :restart => '/bin/foo'))
421
421
  expect(provider).to receive(:daemon_reload?).and_return('no')
422
- expect(provider).to receive(:execute).with(['/bin/systemctl','restart', '--', 'sshd.service'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true).never
423
- expect(provider).to receive(:execute).with(['/bin/foo'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
422
+ expect(provider).to receive(:execute).with(['/bin/systemctl','restart', '--', 'sshd.service'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true}).never
423
+ expect(provider).to receive(:execute).with(['/bin/foo'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
424
424
  provider.restart
425
425
  end
426
426
 
427
427
  it "should restart the service with systemctl restart" do
428
428
  provider = provider_class.new(Puppet::Type.type(:service).new(:name => 'sshd.service'))
429
429
  expect(provider).to receive(:daemon_reload?).and_return('no')
430
- expect(provider).to receive(:execute).with(['/bin/systemctl','restart','--','sshd.service'], :failonfail => true, :override_locale => false, :squelch => false, :combine => true)
430
+ expect(provider).to receive(:execute).with(['/bin/systemctl','restart','--','sshd.service'], {:failonfail => true, :override_locale => false, :squelch => false, :combine => true})
431
431
  provider.restart
432
432
  end
433
433
 
@@ -132,7 +132,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
132
132
 
133
133
  expect(provider).not_to receive(:status_exec).with(['foo'])
134
134
  expect(provider).to receive(:execute)
135
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
135
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
136
136
  .and_return(process_output)
137
137
  provider.status
138
138
  end
@@ -144,7 +144,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
144
144
 
145
145
  expect(provider).not_to receive(:status_exec).with(['foo'])
146
146
  expect(provider).to receive(:execute)
147
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
147
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
148
148
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 1))
149
149
  expect(provider.status).to eq(:stopped)
150
150
  end
@@ -156,7 +156,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
156
156
 
157
157
  expect(provider).not_to receive(:status_exec).with(['foo'])
158
158
  expect(provider).to receive(:execute)
159
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
159
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
160
160
  .and_return(process_output)
161
161
  expect(provider.status).to eq(:running)
162
162
  end
@@ -192,7 +192,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
192
192
 
193
193
  expect(provider).not_to receive(:status_exec).with(['foo'])
194
194
  expect(provider).to receive(:execute)
195
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
195
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
196
196
  .and_return(process_output)
197
197
  provider.status
198
198
  end
@@ -204,7 +204,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
204
204
 
205
205
  expect(provider).not_to receive(:status_exec).with(['foo'])
206
206
  expect(provider).to receive(:execute)
207
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
207
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
208
208
  .and_return(Puppet::Util::Execution::ProcessOutput.new('', 1))
209
209
  expect(provider.status).to eq(:stopped)
210
210
  end
@@ -216,7 +216,7 @@ describe 'Puppet::Type::Service::Provider::Upstart',
216
216
 
217
217
  expect(provider).not_to receive(:status_exec).with(['foo'])
218
218
  expect(provider).to receive(:execute)
219
- .with(['/bin/foo'], :failonfail => false, :override_locale => false, :squelch => false, :combine => true)
219
+ .with(['/bin/foo'], {:failonfail => false, :override_locale => false, :squelch => false, :combine => true})
220
220
  .and_return(process_output)
221
221
  expect(provider.status).to eq(:running)
222
222
  end
@@ -165,7 +165,7 @@ describe 'Puppet::Type::User::Provider::Aix' do
165
165
  allow(mock_tempfile_obj).to receive(:path).and_return('tempfile_path')
166
166
 
167
167
  allow(Tempfile).to receive(:new)
168
- .with("puppet_#{provider.name}_pw", :encoding => Encoding::ASCII)
168
+ .with("puppet_#{provider.name}_pw", {:encoding => Encoding::ASCII})
169
169
  .and_return(mock_tempfile_obj)
170
170
 
171
171
  mock_tempfile_obj
@@ -27,7 +27,7 @@ describe Puppet::Type.type(:user).provider(:hpuxuseradd),
27
27
 
28
28
  context "managing passwords" do
29
29
  let :pwent do
30
- Struct::Passwd.new("testuser", "foopassword")
30
+ Etc::Passwd.new("testuser", "foopassword")
31
31
  end
32
32
 
33
33
  before :each do
@@ -22,7 +22,7 @@ describe Puppet::Type.type(:user).provider(:openbsd) do
22
22
 
23
23
  let(:shadow_entry) {
24
24
  return unless Puppet.features.libshadow?
25
- entry = Struct::PasswdEntry.new
25
+ entry = Etc::PasswdEntry.new
26
26
  entry[:sp_namp] = 'myuser' # login name
27
27
  entry[:sp_loginclass] = 'staff' # login class
28
28
  entry
@@ -29,7 +29,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
29
29
 
30
30
  let(:shadow_entry) {
31
31
  return unless Puppet.features.libshadow?
32
- entry = Struct::PasswdEntry.new
32
+ entry = Etc::PasswdEntry.new
33
33
  entry[:sp_namp] = 'myuser' # login name
34
34
  entry[:sp_pwdp] = '$6$FvW8Ib8h$qQMI/CR9m.QzIicZKutLpBgCBBdrch1IX0rTnxuI32K1pD9.RXZrmeKQlaC.RzODNuoUtPPIyQDufunvLOQWF0' # encrypted password
35
35
  entry[:sp_lstchg] = 15573 # date of last password change
@@ -521,7 +521,7 @@ describe Puppet::Resource::Type do
521
521
  allow(@type).to receive(:code).and_return(code)
522
522
 
523
523
  subscope = double('subscope', :compiler => @compiler)
524
- expect(@scope).to receive(:newscope).with(:source => @type, :resource => @resource).and_return(subscope)
524
+ expect(@scope).to receive(:newscope).with({:source => @type, :resource => @resource}).and_return(subscope)
525
525
 
526
526
  expect(subscope).to receive(:with_guarded_scope).and_yield
527
527
  expect(subscope).to receive(:ephemeral_from).with(match, nil, nil).and_return(subscope)
@@ -546,7 +546,7 @@ describe Puppet::Resource::Type do
546
546
 
547
547
  it "should set all of its parameters in a subscope" do
548
548
  subscope = double('subscope', :compiler => @compiler)
549
- expect(@scope).to receive(:newscope).with(:source => @type, :resource => @resource).and_return(subscope)
549
+ expect(@scope).to receive(:newscope).with({:source => @type, :resource => @resource}).and_return(subscope)
550
550
  expect(@type).to receive(:set_resource_parameters).with(@resource, subscope)
551
551
 
552
552
  @type.evaluate_code(@resource)
@@ -46,7 +46,7 @@ describe Puppet::SSL::Certificate do
46
46
  describe "when initializing wrapped class from a file with #read" do
47
47
  it "should open the file with ASCII encoding" do
48
48
  path = '/foo/bar/cert'
49
- expect(Puppet::FileSystem).to receive(:read).with(path, :encoding => Encoding::ASCII).and_return("bar")
49
+ expect(Puppet::FileSystem).to receive(:read).with(path, {:encoding => Encoding::ASCII}).and_return("bar")
50
50
  @base.read(path)
51
51
  end
52
52
  end
@@ -45,7 +45,7 @@ describe Puppet::SSL::CertificateRequest do
45
45
 
46
46
  it "should be able to read requests from disk" do
47
47
  path = "/my/path"
48
- expect(Puppet::FileSystem).to receive(:read).with(path, :encoding => Encoding::ASCII).and_return("my request")
48
+ expect(Puppet::FileSystem).to receive(:read).with(path, {:encoding => Encoding::ASCII}).and_return("my request")
49
49
  my_req = double('request')
50
50
  expect(OpenSSL::X509::Request).to receive(:new).with("my request").and_return(my_req)
51
51
  expect(request.read(path)).to equal(my_req)
@@ -156,7 +156,7 @@ describe Puppet::SSL::Certificate do
156
156
 
157
157
  it "should be able to read certificates from disk" do
158
158
  path = "/my/path"
159
- expect(Puppet::FileSystem).to receive(:read).with(path, :encoding => Encoding::ASCII).and_return("my certificate")
159
+ expect(Puppet::FileSystem).to receive(:read).with(path, {:encoding => Encoding::ASCII}).and_return("my certificate")
160
160
  certificate = double('certificate')
161
161
  expect(OpenSSL::X509::Certificate).to receive(:new).with("my certificate").and_return(certificate)
162
162
  expect(@certificate.read(path)).to equal(certificate)
@@ -247,7 +247,7 @@ describe Puppet::Transaction::EventManager do
247
247
 
248
248
  it "should queue a new noop event generated from the resource" do
249
249
  event = Puppet::Transaction::Event.new
250
- expect(@resource).to receive(:event).with(:status => "noop", :name => :noop_restart).and_return(event)
250
+ expect(@resource).to receive(:event).with({:status => "noop", :name => :noop_restart}).and_return(event)
251
251
  expect(@manager).to receive(:queue_events).with(@resource, [event])
252
252
 
253
253
  @manager.process_events(@resource)
@@ -277,7 +277,7 @@ describe Puppet::Transaction::EventManager do
277
277
 
278
278
  it "should queue a new noop event generated from the resource" do
279
279
  event = Puppet::Transaction::Event.new
280
- expect(@resource).to receive(:event).with(:status => "noop", :name => :noop_restart).and_return(event)
280
+ expect(@resource).to receive(:event).with({:status => "noop", :name => :noop_restart}).and_return(event)
281
281
  expect(@manager).to receive(:queue_events).with(@resource, [event])
282
282
 
283
283
  @manager.process_events(@resource)
@@ -295,7 +295,7 @@ RSpec.describe Puppet::Type.type(:exec) do
295
295
 
296
296
  it "accepts the current user" do
297
297
  allow(Puppet.features).to receive(:root?).and_return(false)
298
- allow(Etc).to receive(:getpwuid).and_return(Struct::Passwd.new('input'))
298
+ allow(Etc).to receive(:getpwuid).and_return(Etc::Passwd.new('input'))
299
299
 
300
300
  type = Puppet::Type.type(:exec).new(:name => '/bin/true whatever', :user => 'input')
301
301
 
@@ -80,7 +80,7 @@ describe Puppet::Util::Backups do
80
80
  end
81
81
 
82
82
  it "a copy should be created in the local directory" do
83
- expect(FileUtils).to receive(:cp_r).with(path, backup, :preserve => true)
83
+ expect(FileUtils).to receive(:cp_r).with(path, backup, {:preserve => true})
84
84
  allow(Puppet::FileSystem).to receive(:exist?).with(path).and_return(true)
85
85
 
86
86
  expect(file.perform_backup).to be_truthy