diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6d718b6..2fdaf42 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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 diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..97ceee1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.5 \ No newline at end of file diff --git a/jsonapi-matchers.gemspec b/jsonapi-matchers.gemspec index 3d3c2c6..055ea60 100644 --- a/jsonapi-matchers.gemspec +++ b/jsonapi-matchers.gemspec @@ -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 diff --git a/spec/jsonapi/attributes_included_spec.rb b/spec/jsonapi/attributes_included_spec.rb index 76db731..c9ebdba 100644 --- a/spec/jsonapi/attributes_included_spec.rb +++ b/spec/jsonapi/attributes_included_spec.rb @@ -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 @@ -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) } @@ -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 @@ -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) } @@ -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) } @@ -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) } @@ -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) }