diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 035cd8a..191094d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [ "2.3", "2.4", "2.5", "2.6", "2.7", "3.0" ] + ruby-version: [ "3.0", "3.1", "3.2", "3.3", "3.4" ] steps: - name: Checkout diff --git a/.gitignore b/.gitignore index a217564..d82ea09 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ test/version_tmp *.o *.a mkmf.log +.DS_Store diff --git a/lib/openxml/has_attributes.rb b/lib/openxml/has_attributes.rb index 15d3910..d97ef99 100644 --- a/lib/openxml/has_attributes.rb +++ b/lib/openxml/has_attributes.rb @@ -162,7 +162,7 @@ def valid_in?(value, list) end def matches?(value, regexp) - return if value =~ regexp + return if value.is_a?(String) && value =~ regexp raise ArgumentError, "Value does not match #{regexp}" end diff --git a/test/has_properties_test.rb b/test/has_properties_test.rb index 15a344f..78bd2d0 100644 --- a/test/has_properties_test.rb +++ b/test/has_properties_test.rb @@ -130,9 +130,9 @@ def tag end should "call to_xml on each property" do - builder = Nokogiri::XML::Builder.new + builder = OpenXml::Builder.new mock = MiniTest::Mock.new - def mock.render?; true; end + mock.expect(:render?, true) mock.expect(:to_xml, nil, [ builder ]) OpenXml::Properties::BooleanProperty.stub :new, mock do diff --git a/test/test_helper.rb b/test/test_helper.rb index b4d9307..5958bce 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,7 +9,7 @@ require "rr" require "minitest/reporters/turn_reporter" -MiniTest::Reporters.use! Minitest::Reporters::TurnReporter.new +Minitest::Reporters.use! Minitest::Reporters::TurnReporter.new require "shoulda/context" require "pry"