From de5d960a923d362cc544ae7ebc770f11044b197e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 12 Mar 2019 19:07:53 +0100 Subject: Remove old 1.9 stuff --- spec/commands/exec_spec.rb | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index fd76caf2c4..08049cefb8 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -537,11 +537,6 @@ RSpec.describe "bundle exec" do let(:executable) do ex = super() ex << "\n" - if LessThanProc.with(RUBY_VERSION).call("1.9") - # Ruby < 1.9 needs a flush for a exit by signal, later - # rubies do not - ex << "STDOUT.flush\n" - end ex << "raise SignalException, 'SIGTERM'\n" ex end @@ -560,13 +555,8 @@ RSpec.describe "bundle exec" do let(:exit_code) { 0 } let(:expected) { "#{path} is empty" } let(:expected_err) { "" } - if LessThanProc.with(RUBY_VERSION).call("1.9") - # Kernel#exec in ruby < 1.9 will raise Errno::ENOEXEC if the command content is empty, - # even if the command is set as an executable. - pending "Kernel#exec is different" - else - it_behaves_like "it runs" - end + + it_behaves_like "it runs" end context "the executable is empty", :bundler => "2" do @@ -694,21 +684,13 @@ __FILE__: #{path.to_s.inspect} context "when the path is relative" do let(:path) { super().relative_path_from(bundled_app) } - if LessThanProc.with(RUBY_VERSION).call("1.9") - pending "relative paths have ./ __FILE__" - else - it_behaves_like "it runs" - end + it_behaves_like "it runs" end context "when the path is relative with a leading ./" do let(:path) { Pathname.new("./#{super().relative_path_from(Pathname.pwd)}") } - if LessThanProc.with(RUBY_VERSION).call("< 1.9") - pending "relative paths with ./ have absolute __FILE__" - else - it_behaves_like "it runs" - end + pending "relative paths with ./ have absolute __FILE__" end end -- cgit v1.2.1 From ac282dc9de5e20db85e9cdf23b97763a2a2cc292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 12 Mar 2019 21:08:26 +0100 Subject: Remove unused filter --- spec/spec_helper.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dbfeb30db7..fc085a4b10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -84,11 +84,8 @@ RSpec.configure do |config| config.filter_run_excluding :realworld => true end - git_version = Bundler::Source::Git::GitProxy.new(nil, nil, nil).version - config.filter_run_excluding :ruby => LessThanProc.with(RUBY_VERSION) config.filter_run_excluding :rubygems => LessThanProc.with(Gem::VERSION) - config.filter_run_excluding :git => LessThanProc.with(git_version) config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") config.filter_run_excluding :bundler => LessThanProc.with(Bundler::VERSION.split(".")[0, 2].join(".")) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? -- cgit v1.2.1 From e2d839fb7e711aa420a0f0165618bbb3b381b2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 2 Mar 2019 14:45:10 +0100 Subject: Remove LessThanProc --- spec/spec_helper.rb | 6 +++--- spec/support/less_than_proc.rb | 20 -------------------- spec/support/requirement_checker.rb | 11 +++++++++++ 3 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 spec/support/less_than_proc.rb create mode 100644 spec/support/requirement_checker.rb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fc085a4b10..4cc15d2b4c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -84,10 +84,10 @@ RSpec.configure do |config| config.filter_run_excluding :realworld => true end - config.filter_run_excluding :ruby => LessThanProc.with(RUBY_VERSION) - config.filter_run_excluding :rubygems => LessThanProc.with(Gem::VERSION) + config.filter_run_excluding :ruby => RequirementChecker.against(RUBY_VERSION) + config.filter_run_excluding :rubygems => RequirementChecker.against(Gem::VERSION) config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") - config.filter_run_excluding :bundler => LessThanProc.with(Bundler::VERSION.split(".")[0, 2].join(".")) + config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0, 2].join(".")) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? config.filter_run_when_matching :focus unless ENV["CI"] diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb deleted file mode 100644 index 68d37b44c9..0000000000 --- a/spec/support/less_than_proc.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class LessThanProc < Proc - attr_accessor :present - - def self.with(present) - provided = Gem::Version.new(present.dup) - new do |required| - if required.is_a?(String) && required =~ /[=><~]/ - !Gem::Requirement.new(required).satisfied_by?(provided) - else - provided < Gem::Version.new(required) - end - end.tap {|l| l.present = present } - end - - def inspect - "\"=< #{present}\"" - end -end diff --git a/spec/support/requirement_checker.rb b/spec/support/requirement_checker.rb new file mode 100644 index 0000000000..d8f5fd5e5f --- /dev/null +++ b/spec/support/requirement_checker.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RequirementChecker < Proc + def self.against(present) + provided = Gem::Version.new(present) + + new do |required| + !Gem::Requirement.new(required).satisfied_by?(provided) + end + end +end -- cgit v1.2.1 From 30fa1db6b2e58013d2ce55da12c6e9552bf45ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 12 Mar 2019 21:23:38 +0100 Subject: We only filter major versions of bundler --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4cc15d2b4c..92de792b1d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -87,7 +87,7 @@ RSpec.configure do |config| config.filter_run_excluding :ruby => RequirementChecker.against(RUBY_VERSION) config.filter_run_excluding :rubygems => RequirementChecker.against(Gem::VERSION) config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master") - config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0, 2].join(".")) + config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0]) config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil? config.filter_run_when_matching :focus unless ENV["CI"] -- cgit v1.2.1