Merge pull request #1361 from AlfonsoUceda/support-ruby-3.1
Add ruby 3.1 to the test matrix
This commit is contained in:
commit
210f432a8b
|
@ -63,13 +63,15 @@ jobs:
|
|||
# in case it still produces any deprecation warnings.
|
||||
#
|
||||
# See "Lowest supported ruby version" in CONTRIBUTING.md
|
||||
ruby: [ '2.6', '2.7', '3.0' ]
|
||||
ruby: [ '2.6', '2.7', '3.0', '3.1' ]
|
||||
|
||||
exclude:
|
||||
# rails 5.2 requires ruby < 3.0
|
||||
# https://github.com/rails/rails/issues/40938
|
||||
- ruby: '3.0'
|
||||
gemfile: 'rails_5.2'
|
||||
- ruby: '3.1'
|
||||
gemfile: 'rails_5.2'
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v2
|
||||
|
|
|
@ -35,7 +35,11 @@ RSpec.describe Gadget, type: :model do
|
|||
gadget.update_attribute(:updated_at, Time.current + 1)
|
||||
}.to(change { gadget.versions.size }.by(1))
|
||||
expect(
|
||||
YAML.load(gadget.versions.last.object_changes).keys
|
||||
if ::YAML.respond_to?(:unsafe_load)
|
||||
YAML.unsafe_load(gadget.versions.last.object_changes).keys
|
||||
else
|
||||
YAML.load(gadget.versions.last.object_changes).keys
|
||||
end
|
||||
).to eq(["updated_at"])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,7 +27,11 @@ RSpec.describe NoObject, versioning: true do
|
|||
|
||||
# New feature: destroy populates object_changes
|
||||
# https://github.com/paper-trail-gem/paper_trail/pull/1123
|
||||
h = YAML.load a["object_changes"]
|
||||
h = if ::YAML.respond_to?(:unsafe_load)
|
||||
YAML.unsafe_load a["object_changes"]
|
||||
else
|
||||
YAML.load a["object_changes"]
|
||||
end
|
||||
expect(h["id"]).to eq([n.id, nil])
|
||||
expect(h["letter"]).to eq([n.letter, nil])
|
||||
expect(h["created_at"][0]).to be_present
|
||||
|
|
|
@ -21,7 +21,11 @@ module PaperTrail
|
|||
let(:data) { described_class.new(skipper, false).data }
|
||||
|
||||
it "includes `object` without skipped attributes" do
|
||||
object = YAML.load(data[:object])
|
||||
object = if ::YAML.respond_to?(:unsafe_load)
|
||||
YAML.unsafe_load(data[:object])
|
||||
else
|
||||
YAML.load(data[:object])
|
||||
end
|
||||
expect(object["id"]).to eq(skipper.id)
|
||||
expect(object).to have_key("updated_at")
|
||||
expect(object).to have_key("created_at")
|
||||
|
@ -29,7 +33,11 @@ module PaperTrail
|
|||
end
|
||||
|
||||
it "includes `object_changes` without skipped and ignored attributes" do
|
||||
changes = YAML.load(data[:object_changes])
|
||||
changes = if ::YAML.respond_to?(:unsafe_load)
|
||||
YAML.unsafe_load(data[:object_changes])
|
||||
else
|
||||
YAML.load(data[:object_changes])
|
||||
end
|
||||
expect(changes["id"]).to eq([skipper.id, nil])
|
||||
expect(changes["updated_at"][0]).to be_present
|
||||
expect(changes["updated_at"][1]).to be_nil
|
||||
|
|
Loading…
Reference in New Issue