From d35e97b354e094500af520ae556555372326d4b5 Mon Sep 17 00:00:00 2001 From: Benjamin Woosley Date: Tue, 21 May 2024 16:15:58 -0500 Subject: [PATCH] test: Drop tests targeting ruby before 3.0 --- spec/definition_spec.rb | 13 ++----------- spec/regression_spec.rb | 24 ------------------------ 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 spec/regression_spec.rb diff --git a/spec/definition_spec.rb b/spec/definition_spec.rb index 72e09f8f..3779f381 100644 --- a/spec/definition_spec.rb +++ b/spec/definition_spec.rb @@ -287,17 +287,8 @@ def self.from_xml(val) expect(@definition.blocks.first['0.3']).to eq(BigDecimal("0.3")) end - # Ruby behavior of BigDecimal changed in 2.4, this test is not valid on older rubies - if RUBY_VERSION >= "2.4" - it "should raise on non-decimal values" do - expect { @definition.blocks.first['junk 11'] }.to raise_error(ArgumentError) - end - end - - if RUBY_VERSION < "2.6" - it "should extract what it can" do - expect(@definition.blocks.first['11sttf']).to eql(BigDecimal("11.0")) - end + it "should raise on non-decimal values" do + expect { @definition.blocks.first['junk 11'] }.to raise_error(ArgumentError) end context "when passed an array" do diff --git a/spec/regression_spec.rb b/spec/regression_spec.rb deleted file mode 100644 index 63c07727..00000000 --- a/spec/regression_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper' - -describe ROXML do - describe 'frozen nils' do - subject { nil } - - # Prior to ruby-2.2, nil was not frozen. This test watches for - # a regression in previous versions of roxml that caused nil to - # become frozen. FIXME: remove after ruby-2.1 support is removed. - if RUBY_VERSION < "2.2" - context 'before unmarshalling an XML document' do - it { is_expected.to_not be_frozen } - end - - context 'after unmarshalling an XML document' do - before do - lib = Library.from_xml(fixture(:library)) - end - - it { is_expected.to_not be_frozen } - end - end - end -end