summaryrefslogtreecommitdiff
path: root/spec/support/shared/integration/knife_support.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared/integration/knife_support.rb')
-rw-r--r--spec/support/shared/integration/knife_support.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb
index fd12998152..30293be6cf 100644
--- a/spec/support/shared/integration/knife_support.rb
+++ b/spec/support/shared/integration/knife_support.rb
@@ -103,6 +103,9 @@ module KnifeSupport
private
class KnifeResult
+
+ include ::RSpec::Matchers
+
def initialize(stdout, stderr, exit_code)
@stdout = stdout
@stderr = stderr
@@ -150,20 +153,20 @@ module KnifeSupport
stderr_actual = @stderr.sub(/^WARNING: No knife configuration file found\n/, '')
if expected[:stderr].is_a?(Regexp)
- stderr_actual.should =~ expected[:stderr]
+ expect(stderr_actual).to match(expected[:stderr])
else
- stderr_actual.should == expected[:stderr]
+ expect(stderr_actual).to eq(expected[:stderr])
end
stdout_actual = @stdout
if Chef::Platform.windows?
stderr_actual = stderr_actual.gsub("\r\n", "\n")
stdout_actual = stdout_actual.gsub("\r\n", "\n")
end
- @exit_code.should == expected[:exit_code]
+ expect(@exit_code).to eq(expected[:exit_code])
if expected[:stdout].is_a?(Regexp)
- stdout_actual.should =~ expected[:stdout]
+ expect(stdout_actual).to match(expected[:stdout])
else
- stdout_actual.should == expected[:stdout]
+ expect(stdout_actual).to eq(expected[:stdout])
end
end
end