summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-07-16 11:23:21 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-07-16 11:23:21 -0700
commit2e49a09c93abbf611eb1bfeb3f120a593301b78f (patch)
tree91e290d2b21460a782de46900c4f4358f5ef9015 /spec
parent8e8b6c43f783a31aa91c19291299203f40a39224 (diff)
downloadmixlib-shellout-2e49a09c93abbf611eb1bfeb3f120a593301b78f.tar.gz
this API isn't supported in 2.2
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/helper_spec.rb2
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/dependency_helper.rb14
3 files changed, 16 insertions, 1 deletions
diff --git a/spec/mixlib/shellout/helper_spec.rb b/spec/mixlib/shellout/helper_spec.rb
index 977568a..58b95e6 100644
--- a/spec/mixlib/shellout/helper_spec.rb
+++ b/spec/mixlib/shellout/helper_spec.rb
@@ -2,7 +2,7 @@ require "spec_helper"
require "mixlib/shellout/helper"
require "logger"
-describe Mixlib::ShellOut::Helper do
+describe Mixlib::ShellOut::Helper, ruby: ">= 2.3" do
class TestClass
include Mixlib::ShellOut::Helper
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1f3c818..fb60fe7 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,6 +19,7 @@ RSpec.configure do |config|
config.filter_run_excluding windows_only: true unless windows?
config.filter_run_excluding unix_only: true unless unix?
config.filter_run_excluding requires_root: true unless root?
+ config.filter_run_excluding ruby: DependencyProc.with(RUBY_VERSION)
config.run_all_when_everything_filtered = true
diff --git a/spec/support/dependency_helper.rb b/spec/support/dependency_helper.rb
new file mode 100644
index 0000000..f4f1af8
--- /dev/null
+++ b/spec/support/dependency_helper.rb
@@ -0,0 +1,14 @@
+class DependencyProc < Proc
+ attr_accessor :present
+
+ def self.with(present)
+ provided = Gem::Version.new(present.dup)
+ new do |required|
+ !Gem::Requirement.new(required).satisfied_by?(provided)
+ end.tap { |l| l.present = present }
+ end
+
+ def inspect
+ "\"#{present}\""
+ end
+end