dev-sec/windows-baseline

Error `undefined method `positive?' for #<RSpec::Matchers::DSL::Matcher cmp>`

spencer-cdw opened this issue · 1 comments

On the windows baseline, I'm finding the following error

undefined method `positive?' for #<RSpec::Matchers::DSL::Matcher cmp>

inspec is using a method cmp.positive?

    its('MaximumPasswordAge') { should cmp.positive? }

https://github.com/dev-sec/windows-baseline/blob/master/controls/local_policies.rb#L1291-L1318

cmp.positive? does not appear to be a valid method on the RSpec::Matchers::DSL::Matcher class

https://rspec.info/documentation/3.0/rspec-expectations/RSpec/Matchers/DSL/Matcher.html

inspec --version
5.18.14

There is only 1 example in this repo of .positive? being used.

Here is the commit where it was changed. https://github.com/dev-sec/windows-baseline/pull/50/files

Previous versions used the its('MaximumPasswordAge') { should cmp > 0 } syntax

Additional fix: #61