Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit e4b9c47

Browse files
committed
Fix tests on Chef master for new execute provider implementation.
1 parent 4f44c87 commit e4b9c47

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/spec/resources/ruby_execute_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
end
3131

3232
it do
33-
expect_any_instance_of(described_class::Provider).to receive(:shell_out!).with(
33+
# Check which method to stub. I'm not super proud of this code, sorry.
34+
method_to_stub = if IO.read(described_class::Provider.instance_method(:action_run).source_location.first) =~ /shell_out_with_systems_locale/
35+
:shell_out_with_systems_locale!
36+
else
37+
:shell_out!
38+
end
39+
expect_any_instance_of(described_class::Provider).to receive(method_to_stub).with(
3440
'/ruby myapp.rb',
3541
user: 'myuser',
3642
group: 'mygroup',

0 commit comments

Comments
 (0)