Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mocha to v2.0.0.alpha.1 without deployment actions #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/deploy.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/set-automatic-deploys-enabled.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ GEM
minitest-stub-const (0.6)
mlanett-redis-lock (0.2.7)
redis
mocha (1.15.0)
mocha (2.0.0.alpha.1)
msgpack (1.5.6)
multi_json (1.15.0)
multi_test (1.1.0)
Expand Down
6 changes: 3 additions & 3 deletions app/services/asset_manager/asset_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def initialize(attachment_data_id, legacy_url_path)
end
end

def self.call(*args)
new.call(*args)
def self.call(...)
new.call(...)
end

def call(asset_data, legacy_url_path, new_attributes = {})
def call(asset_data, legacy_url_path, **new_attributes)
attributes = find_asset_by(legacy_url_path)
asset_deleted = attributes["deleted"]

Expand Down
2 changes: 1 addition & 1 deletion app/services/asset_manager/attachment_updater/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def call
AssetManager::AssetUpdater.call(
attachment_data,
legacy_url_path,
new_attributes.deep_stringify_keys,
**new_attributes.deep_stringify_keys,
)
end

Expand Down
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
Whitehall::Application.load_tasks if Rake::Task.tasks.empty?

Mocha.configure do |c|
c.reinstate_undocumented_behaviour_from_v1_9 = false
c.stubbing_non_existent_method = :prevent
end

Expand Down
4 changes: 2 additions & 2 deletions test/unit/services/asset_manager/asset_updater_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AssetManager::AssetUpdaterTest < ActiveSupport::TestCase
.with(@asset_id, "replacement_id" => replacement_id)

attributes = { "replacement_legacy_url_path" => replacement_legacy_url_path }
@worker.call(@attachment_data, @legacy_url_path, attributes)
@worker.call(@attachment_data, @legacy_url_path, **attributes)
end

test "does not mark asset as replaced if already replaced by same asset" do
Expand All @@ -130,6 +130,6 @@ class AssetManager::AssetUpdaterTest < ActiveSupport::TestCase
Services.asset_manager.expects(:update_asset).never

attributes = { "replacement_legacy_url_path" => replacement_legacy_url_path }
@worker.call(@attachment_data, @legacy_url_path, attributes)
@worker.call(@attachment_data, @legacy_url_path, **attributes)
end
end