mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
allow integers to be cmp regexed
This commit is contained in:
parent
9b199c9223
commit
b38e71b6f2
1 changed files with 2 additions and 2 deletions
|
@ -248,8 +248,8 @@ RSpec::Matchers.define :cmp do |first_expected|
|
|||
# if actual and expected are strings
|
||||
if expected.is_a?(String) && actual.is_a?(String)
|
||||
return actual.casecmp(expected) == 0 if op == :==
|
||||
elsif expected.is_a?(Regexp) && actual.is_a?(String)
|
||||
return !actual.match(expected).nil?
|
||||
elsif expected.is_a?(Regexp) && (actual.is_a?(String) || actual.is_a?(Integer))
|
||||
return !actual.to_s.match(expected).nil?
|
||||
elsif expected.is_a?(String) && integer?(expected) && actual.is_a?(Integer)
|
||||
return actual.method(op).call(expected.to_i)
|
||||
elsif expected.is_a?(Integer) && integer?(actual)
|
||||
|
|
Loading…
Reference in a new issue