diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-03 16:22:23 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-03 16:22:23 -0800 |
commit | 5fd3c2f8376d7264d8ca4f883c9dfc4fbfb9b0d3 (patch) | |
tree | 41d861f8d67a80b1c789357c81545517ea00bd0c /spec/spec_helper.rb | |
parent | 0b835a0a92509c5d9ad4123d320024da0005dac3 (diff) | |
download | chef-5fd3c2f8376d7264d8ca4f883c9dfc4fbfb9b0d3.tar.gz |
better chef+ruby rspec constraints
lets us use Gem::Dependency constraints directly as rspec
constraints for matching Chef::Version and RUBY_VERSION.
copies some magic sauce from bundler that does something
similar
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8ba4c8eb70..7d64f1afcd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -154,11 +154,6 @@ RSpec.configure do |config| config.filter_run_excluding :debian_family_only => true unless debian_family? config.filter_run_excluding :supports_cloexec => true unless supports_cloexec? config.filter_run_excluding :selinux_only => true unless selinux_enabled? - config.filter_run_excluding :ruby_20_only => true unless ruby_20? - # chef_gte_XX_only and chef_lt_XX_only pair up correctly with the same XX - # number. please conserve this pattern & resist filling out all the operators - config.filter_run_excluding :chef_gte_13_only => true unless chef_gte_13? - config.filter_run_excluding :chef_lt_13_only => true unless chef_lt_13? config.filter_run_excluding :requires_root => true unless root? config.filter_run_excluding :requires_root_or_running_windows => true unless root? || windows? config.filter_run_excluding :requires_unprivileged_user => true if root? @@ -170,6 +165,10 @@ RSpec.configure do |config| config.filter_run_excluding :not_wpar => true unless wpar? config.filter_run_excluding :not_supported_under_fips => true if fips? + # these let us use chef: ">= 13" or ruby: "~> 2.0.0" or any other Gem::Dependency-style constraint + config.filter_run_excluding chef: DependencyProc.with(Chef::VERSION) + config.filter_run_excluding ruby: DependencyProc.with(RUBY_VERSION) + running_platform_arch = `uname -m`.strip unless windows? config.filter_run_excluding :arch => lambda {|target_arch| |