Skip to content

Commit

Permalink
Merge pull request #4122 from zendesk/grosser/rails
Browse files Browse the repository at this point in the history
remove minitest-rails
  • Loading branch information
grosser authored Nov 18, 2024
2 parents 20bfecc + 4876ddd commit 2160a36
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ group :development, :test do
end

group :test do
gem 'minitest-rails'
gem 'rails-controller-testing'
gem 'maxitest'
gem 'mocha'
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,6 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.14.4)
minitest-rails (6.1.1)
minitest (~> 5.10)
railties (~> 6.1.0)
mixlib-shellout (3.2.7)
chef-utils
mocha (2.1.0)
Expand Down Expand Up @@ -715,7 +712,6 @@ DEPENDENCIES
mail (~> 2.7.0)
marco-polo
maxitest
minitest-rails
mocha
momentjs-rails
mysql2
Expand Down
4 changes: 2 additions & 2 deletions plugins/airbrake/test/samson_airbrake/samson_plugin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
it 'shows debug info and calls notify_sync if sync is true' do
mock_notice = mock
mock_exception = mock
Airbrake.expects(:notify_sync).with(mock_exception, foo: 'bar').once.returns(mock_notice)
Airbrake.expects(:notify_sync).with(mock_exception, {foo: 'bar'}).once.returns(mock_notice)
SamsonAirbrake::SamsonPlugin.expects(:exception_debug_info).with(mock_notice).once

Samson::Hooks.only_callbacks_for_plugin('airbrake', :error) do
Expand All @@ -34,7 +34,7 @@

it 'calls notify if sync is false/nil' do
mock_exception = mock
Airbrake.expects(:notify).with(mock_exception, foo: 'bar').once
Airbrake.expects(:notify).with(mock_exception, {foo: 'bar'}).once

Samson::Hooks.only_callbacks_for_plugin('airbrake', :error) do
Samson::Hooks.fire(:error, mock_exception, foo: 'bar')
Expand Down
10 changes: 7 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
SingleCov.rewrite { |path| path.sub("/lib/decorators/", "/decorators/") }
SingleCov.setup :minitest, branches: true unless defined?(Spring)

# rake adds these, but we don't need them / want to be consistent with using `ruby x_test.rb`
# rake adds these, but we don't need them and want to be consistent with using `ruby x_test.rb`
$LOAD_PATH.delete 'lib'
$LOAD_PATH.delete 'test'

require 'maxitest/global_must'
require_relative '../config/environment'
require 'rails/test_help'
require 'minitest/rails'
require 'rails-controller-testing'
Rails::Controller::Testing.install
require 'maxitest/autorun'
Expand All @@ -25,13 +24,16 @@
require 'webmock/minitest'
require 'mocha/minitest'

# Add spec DSL to the TestCase class
ActiveSupport.on_load(:active_support_test_case) { extend Minitest::Spec::DSL }

# Use ActiveSupport::TestCase for everything that was not matched before
MiniTest::Spec::DSL::TYPES[-1] = [//, ActiveSupport::TestCase]

# Use ActionController::TestCase for Controllers
MiniTest::Spec::DSL::TYPES.unshift [/Controller$/, ActionController::TestCase]

# Use ActionDispatch::IntegrationTest for everything that is marked Integration
# Use ActionDispatch::IntegrationTest for everything that is Controller or marked Integration
MiniTest::Spec::DSL::TYPES.unshift [/Integration$/, ActionDispatch::IntegrationTest]

# Use ActionView::TestCase for Helpers
Expand All @@ -57,6 +59,8 @@ def capture(into)
include ApplicationHelper
include Warden::Test::Helpers

alias_method :refute_difference, :assert_no_difference

fixtures :all

before { Rails.cache.clear }
Expand Down

0 comments on commit 2160a36

Please sign in to comment.