diff options
author | Claire McQuin <claire@getchef.com> | 2014-10-29 15:42:21 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-10-29 15:59:04 -0700 |
commit | 465edcf3231d08f8274c7cc454d4197c62ffd32e (patch) | |
tree | 752b9d39c8302095f6e9a1494f459251cfc36728 /spec | |
parent | 5fed7a65a2f024d964ecf2de1bcf2911cf8a600c (diff) | |
download | chef-465edcf3231d08f8274c7cc454d4197c62ffd32e.tar.gz |
Use expect syntax.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/shared/integration/knife_support.rb | 13 |
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 |