Skip to content

Commit

Permalink
Bump gems and support rails < 8
Browse files Browse the repository at this point in the history
  • Loading branch information
bogderp committed Nov 21, 2024
1 parent 85cc6a5 commit 71628fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1.152.0
uses: ruby/setup-ruby@v1.202.0
with:
ruby-version: 3.1.4
ruby-version: 3.3.6
bundler-cache: true
- name: Install dependencies
run: bundle install
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.5
10 changes: 5 additions & 5 deletions jsonapi-matchers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.7.7"
spec.required_ruby_version = ">= 3.1.5"

spec.add_dependency "activesupport", ">= 4.0", "< 7.1"
spec.add_dependency "activesupport", ">= 7.0", "< 8"
spec.add_dependency "awesome_print"

spec.add_development_dependency "bump", "~> 0.9.0"
spec.add_development_dependency "bump", "~> 0.10.0"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rake", "~> 13.2"
spec.add_development_dependency "rspec", "~> 3.13"
spec.add_development_dependency "pry"
end
18 changes: 9 additions & 9 deletions spec/jsonapi/attributes_included_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@

describe 'with_record' do
context 'record exists' do
let(:record) { OpenStruct.new(id: 'some-car-id') }
let(:record) { Struct.new(:id).new('some-car-id') }

it 'matches' do
expect(have_relationship(:car).with_record(record).matches?(target)).to be_truthy
end

context 'the record id is not a string' do
let(:record) { OpenStruct.new(id: 3) }
let(:record) { Struct.new(:id).new(3) }

it 'matches' do
expect(have_relationship(:bike).with_record(record).matches?(target)).to be_truthy
Expand All @@ -281,7 +281,7 @@
end

context 'record id does not match' do
let(:record) { OpenStruct.new(id: 'not-the-right-car-id') }
let(:record) { Struct.new(:id).new('not-the-right-car-id') }

subject { have_relationship(:car).with_record(record) }

Expand All @@ -296,14 +296,14 @@
end

context 'relationship is array and it matches' do
let(:record) { OpenStruct.new(id: 'some-chair-id-1') }
let(:record) { Struct.new(:id).new('some-chair-id-1') }

it 'matches' do
expect(have_relationship(:chairs).with_record(record).matches?(target)).to be_truthy
end

context 'the record id is not a string' do
let(:record) { OpenStruct.new(id: 4) }
let(:record) { Struct.new(:id).new(4) }

it 'matches' do
expect(have_relationship(:telephones).with_record(record).matches?(target)).to be_truthy
Expand All @@ -312,7 +312,7 @@
end

context 'relationship is array and it does not match' do
let(:record) { OpenStruct.new(id: 'some-chair-id-3') }
let(:record) { Struct.new(:id).new('some-chair-id-3') }

subject { have_relationship(:chairs).with_record(record) }

Expand All @@ -327,7 +327,7 @@
end

context 'relationship does not have an id attribute' do
let(:record) { OpenStruct.new(id: 'some-chair-id-1') }
let(:record) { Struct.new(:id).new('some-chair-id-1') }

subject { have_relationship(:house).with_record(record) }

Expand All @@ -342,7 +342,7 @@
end

context 'relationship is nil' do
let(:record) { OpenStruct.new(id: 'some-chair-id-1') }
let(:record) { Struct.new(:id).new('some-chair-id-1') }

subject { have_relationship(:plane).with_record(record) }

Expand All @@ -357,7 +357,7 @@
end

context 'relationship does not exist' do
let(:record) { OpenStruct.new(id: 'some-chair-id-1') }
let(:record) { Struct.new(:id).new('some-chair-id-1') }

subject { have_relationship(:does_not_exist).with_record(record) }

Expand Down

0 comments on commit 71628fc

Please sign in to comment.