inspec/test/integration/matcher_test.rb
Rony Xavier 041f64a87f New 'be_in' matcher for matching against values in a list (#2022)
* New matcher 'be_in'
Fixes #2018

Signed-off-by: Rony Xavier <rx294@nyu.edu>

* small fixes to wording.

Signed-off-by: Aaron Lippold <lippold@gmail.com>

* Added code to use be_in for with the following use case:
describe nginx do
   its(module_list) { should be_in AUTHORIZED_MODULE_LIST }
end
Fixes #2018

Signed-off-by: Rony Xavier <rx294@nyu.edu>

* Updates to the matcher
Fixes #2018

Signed-off-by: Rony Xavier <rx294@nyu.edu>

* Added tests for the be_in matcher

Signed-off-by: Rony Xavier <rx294@nyu.edu>

* Requested updates completed

Signed-off-by: Rony Xavier <rx294@nyu.edu>
2017-08-07 16:05:22 +02:00

22 lines
473 B
Ruby

# encoding: utf-8
# author: Rony Xavier, rx294@gmail.com
# matcher be_in test
INSTALLED_MODULES = ['module1', 'module2', 'module3', 'module4', 'module5']
describe 'module1' do
it { should be_in INSTALLED_MODULES}
end
describe ['module1', 'module2', 'module3'] do
it { should be_in INSTALLED_MODULES}
end
describe 'badmodule' do
it { should_not be_in INSTALLED_MODULES}
end
describe ['badmodule1', 'badmodule2'] do
it { should_not be_in INSTALLED_MODULES}
end