-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add regexp to cmp matcher #667
Conversation
I made a small change to support the Integer example in the PR request. It will also provide the Like: describe file('/etc/shadow') do
its('mode') { should cmp /0(0|4)00/ }
end UPDATE: describe file('/etc/shadow') do
its('mode') { should cmp /^(256|0)$/ }
end or converted to octal string:
or for a way to get the file mode in octal. |
While updating the integration tests for For example: bundle exec kitchen verify default-centos-67
...
Finished in 1.43 seconds (files took 1.22 seconds to load)
200 examples, 20 failures, 11 pending
Failed examples:
rspec # Apache Config /etc/httpd/conf/httpd.conf LogLevel should eq "warn"
rspec # Apache Config /etc/httpd/conf/httpd.conf MaxKeepAliveRequests should eq "100"
rspec # should cmp 0
rspec # SSH Configuration Port should eq "22"
rspec # SSH Configuration Port should cmp "22"
rspec # SSH Configuration Port should cmp 22
rspec # SSH Configuration Port should cmp 22.0
rspec # SSH Configuration Port should not cmp 22.1
rspec # SSH Configuration LogLevel should eq "INFO"
rspec # SSH Configuration LogLevel should cmp "INFO"
rspec # SSH Configuration LogLevel should cmp "info"
rspec # SSH Configuration LogLevel should cmp "InfO"
rspec # /etc/group users should include "root"
rspec # #<Inspec::Resources::EtcGroupView:0x007f90a621f6b8> users should include "root"
rspec # File /tmp/file mode should cmp "0765"
rspec # File /mnt/iso-disk should be mounted
rspec # File /mnt/iso-disk should be mounted
rspec # Mount /mnt/iso-disk options should eq ["ro"]
rspec # PostgreSQL query: show ssl; output should eq "on"
rspec # User root groups should include ["root"] Are integration tests not run on PRs? |
@alexpop: currently, they require vagrant and are not run automatically at all. Improvements needed! 👍 |
i.e. `123 should { cmp /2+/ }`
@alexpop let's address the missing tests separately, we might need a workaround with travis here... Everything else looks great 👍 Thank you for the improvements |
Awesome work! These are great improvements! |
i.e.
123 should { cmp /2+/ }