Skip to content

Commit

Permalink
Update minitest -> v5.19.0 & mocha -> v2.1.0
Browse files Browse the repository at this point in the history
The mocha update is required to retain compatibility with minitest. See
freerange/mocha#614 for more details.
  • Loading branch information
floehopper committed Jul 27, 2023
1 parent 2143db4 commit da7ec36
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ GEM
rack (>= 2.1.4.1)
marcel (1.0.2)
matrix (0.4.2)
maxitest (5.1.0)
minitest (>= 5.14.0, < 5.19.0)
maxitest (5.2.0)
minitest (>= 5.14.0, < 5.20.0)
mechanize (2.9.1)
addressable (~> 2.8)
domain_name (~> 0.5, >= 0.5.20190701)
Expand All @@ -403,11 +403,11 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_portile2 (2.8.4)
minitest (5.18.1)
minitest (5.19.0)
minitest-fail-fast (0.1.0)
minitest (~> 5)
minitest-stub-const (0.6)
mocha (2.0.4)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
msgpack (1.6.0)
multi_json (1.15.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Admin::FactCheckRequestsControllerTest < ActionController::TestCase

test "raise an error if an email cannot be sent via notify" do
raises_exception = lambda { |_request, _params|
response = MiniTest::Mock.new
response = Minitest::Mock.new
response.expect :code, 400
response.expect :body, "Can't send to this recipient using a team-only API key"
raise Notifications::Client::BadRequestError, response
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/services/author_notifier_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def notify(environment: nil)

test "does not raise an error if an email cannot be sent via notify in integration" do
raises_exception = lambda { |_author, _edition, _edition_admin_url, _public_document_url|
response = MiniTest::Mock.new
response = Minitest::Mock.new
ENV["SENTRY_CURRENT_ENV"] = "integration-blue-aws"
response.expect :code, 400
response.expect :body, "Can't send to this recipient using a team-only API key"
Expand All @@ -103,7 +103,7 @@ def notify(environment: nil)

test "it raises an error if an email cannot be sent via notify in Production" do
raises_exception = lambda { |_author, _edition, _edition_admin_url, _public_document_url|
response = MiniTest::Mock.new
response = Minitest::Mock.new
ENV["SENTRY_CURRENT_ENV"] = "production"
response.expect :code, 400
response.expect :body, "Can't send to this recipient using a team-only API key"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/services/editon_auth_bypass_updater_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class EditionAuthBypassUpdaterTest < ActiveSupport::TestCase

describe "#call" do
let(:user) { create(:user) }
let(:updater) { MiniTest::Mock.new }
let(:updater) { Minitest::Mock.new }
let(:uid) { SecureRandom.uuid }

before do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require "govspeak/contacts_extractor"

module ServiceListeners
class AttachmentDependencyPopulatorTest < MiniTest::Test
class AttachmentDependencyPopulatorTest < Minitest::Test
class TestAssociation
attr_reader :collection

Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/workers/document_list_export_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DocumentListExportWorkerTest < ActiveSupport::TestCase

test "does not raise an error if an email cannot be sent via notify" do
raises_exception = lambda { |_url, _address, _title|
response = MiniTest::Mock.new
response = Minitest::Mock.new
ENV["SENTRY_CURRENT_ENV"] = "integration-blue-aws"
response.expect :code, 400
response.expect :body, "Can't send to this recipient using a team-only API key"
Expand All @@ -77,7 +77,7 @@ class DocumentListExportWorkerTest < ActiveSupport::TestCase

test "raises an error if an email cannot be sent via notify in production" do
raises_exception = lambda { |_url, _address, _title|
response = MiniTest::Mock.new
response = Minitest::Mock.new
ENV["SENTRY_CURRENT_ENV"] = "production"
response.expect :code, 400
response.expect :body, "Can't send to this recipient using a team-only API key"
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/workers/publishing_api_gone_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class PublishingApiGoneWorkerTest < ActiveSupport::TestCase
end

test "sends an error to sentry if there is a problem with the request" do
govukerror_notify = MiniTest::Mock.new
govukerror_notify = Minitest::Mock.new
govukerror_notify.expect :call, nil, [GdsApi::HTTPUnprocessableEntity]

publishing_api = MiniTest::Mock.new
publishing_api = Minitest::Mock.new
def publishing_api.unpublish(_content_id, _options)
raise GdsApi::HTTPUnprocessableEntity, "test"
end
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app/workers/publishing_api_redirect_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class PublishingApiRedirectWorkerTest < ActiveSupport::TestCase
end

test "sends an error to sentry if there is a problem with the request" do
govukerror_notify = MiniTest::Mock.new
govukerror_notify = Minitest::Mock.new
govukerror_notify.expect :call, nil, [GdsApi::HTTPUnprocessableEntity]

publishing_api = MiniTest::Mock.new
publishing_api = Minitest::Mock.new
def publishing_api.unpublish(_content_id, _options)
raise GdsApi::HTTPUnprocessableEntity, "test"
end
Expand Down

0 comments on commit da7ec36

Please sign in to comment.