Skip to content

Commit

Permalink
Merge pull request #1333 from SplitTime/oveson/require-ostruct-in-del…
Browse files Browse the repository at this point in the history
…ete-topic-resource-key-job

Require ostruct wherever used
  • Loading branch information
moveson authored Dec 17, 2024
2 parents 7423a7a + f8ec6ff commit bd2894c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/jobs/delete_topic_resource_key_job.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "ostruct"

class DeleteTopicResourceKeyJob < ApplicationJob
queue_as :default

Expand Down
1 change: 1 addition & 0 deletions app/models/proto_record.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "etl/etl"
require "ostruct"

class ProtoRecord
include ETL::Transformable
Expand Down
2 changes: 2 additions & 0 deletions app/services/find_not_expected_bibs.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "ostruct"

class FindNotExpectedBibs
include Interactors::Errors
include SplitAnalyzable
Expand Down
1 change: 1 addition & 0 deletions lib/etl/extractors/csv_file_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require "smarter_csv"
require "csv"
require "ostruct"

module ETL
module Extractors
Expand Down
21 changes: 21 additions & 0 deletions spec/jobs/delete_topic_resource_key_job_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe DeleteTopicResourceKeyJob do
subject { described_class.new }

let(:topic_resource_key) { "arn:aws:sns:test" }

describe "#perform" do
let(:perform_job) { subject.perform(topic_resource_key) }
let(:expected_mock_resource) { OpenStruct.new(topic_resource_key: topic_resource_key, slug: topic_resource_key) }

before { allow(SnsTopicManager).to receive(:delete) }

it "sends a message to the topic manager" do
expect(SnsTopicManager).to receive(:delete).with(resource: expected_mock_resource)
perform_job
end
end
end

0 comments on commit bd2894c

Please sign in to comment.