From 0151738333792a810dfc246d747b925c70bd5943 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Fri, 10 Jan 2025 09:37:19 +0000 Subject: [PATCH] Update tests for recent ruby ecosystem changes --- .github/workflows/test-package.yml | 1 + spec/fixtures/apps/rails-initializer-config/Gemfile | 2 ++ spec/fixtures/apps/rails-invalid-initializer-config/Gemfile | 2 ++ spec/fixtures/apps/rails-no-config/Gemfile | 2 ++ spec/report_spec.rb | 6 +++++- 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 5d14f7ee..1caad5c7 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -13,6 +13,7 @@ jobs: optional-groups: ['test sidekiq'] include: - ruby-version: '1.9' + os: 'ubuntu-20.04' optional-groups: 'test' - ruby-version: '2.0' optional-groups: 'test' diff --git a/spec/fixtures/apps/rails-initializer-config/Gemfile b/spec/fixtures/apps/rails-initializer-config/Gemfile index 22958a75..4a31ca88 100644 --- a/spec/fixtures/apps/rails-initializer-config/Gemfile +++ b/spec/fixtures/apps/rails-initializer-config/Gemfile @@ -2,6 +2,8 @@ source 'https://rubygems.org' ruby_version = Gem::Version.new(RUBY_VERSION.dup) +gem 'mutex_m', 0.3.0 if ruby_version >= Gem::Version.new('3.4') + gem 'railties', ruby_version <= Gem::Version.new('2.6') ? '4.2.10' : '~> 6.0.2', require: %w(action_controller rails) gem 'rake', ruby_version <= Gem::Version.new('1.9.3') ? '~> 11.3.0' : '~> 12.3.0' gem 'minitest', ruby_version <= Gem::Version.new('2.2') ? '5.11.3' : '~> 5.14.0' diff --git a/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile b/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile index 22958a75..4a31ca88 100644 --- a/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile +++ b/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile @@ -2,6 +2,8 @@ source 'https://rubygems.org' ruby_version = Gem::Version.new(RUBY_VERSION.dup) +gem 'mutex_m', 0.3.0 if ruby_version >= Gem::Version.new('3.4') + gem 'railties', ruby_version <= Gem::Version.new('2.6') ? '4.2.10' : '~> 6.0.2', require: %w(action_controller rails) gem 'rake', ruby_version <= Gem::Version.new('1.9.3') ? '~> 11.3.0' : '~> 12.3.0' gem 'minitest', ruby_version <= Gem::Version.new('2.2') ? '5.11.3' : '~> 5.14.0' diff --git a/spec/fixtures/apps/rails-no-config/Gemfile b/spec/fixtures/apps/rails-no-config/Gemfile index 22958a75..4a31ca88 100644 --- a/spec/fixtures/apps/rails-no-config/Gemfile +++ b/spec/fixtures/apps/rails-no-config/Gemfile @@ -2,6 +2,8 @@ source 'https://rubygems.org' ruby_version = Gem::Version.new(RUBY_VERSION.dup) +gem 'mutex_m', 0.3.0 if ruby_version >= Gem::Version.new('3.4') + gem 'railties', ruby_version <= Gem::Version.new('2.6') ? '4.2.10' : '~> 6.0.2', require: %w(action_controller rails) gem 'rake', ruby_version <= Gem::Version.new('1.9.3') ? '~> 11.3.0' : '~> 12.3.0' gem 'minitest', ruby_version <= Gem::Version.new('2.2') ? '5.11.3' : '~> 5.14.0' diff --git a/spec/report_spec.rb b/spec/report_spec.rb index a6c3bd5a..9d7273bf 100644 --- a/spec/report_spec.rb +++ b/spec/report_spec.rb @@ -2089,9 +2089,13 @@ def to_s it "works with java.lang.Throwables" do begin + pp "I'm failing!" JRubyException.raise! - rescue + pp "I've failed" + rescue => e + pp "I'm notifying! #{e.message}" Bugsnag.notify $! + pp "I've notified!" end expect(Bugsnag).to have_sent_notification{ |payload, headers|