Skip to content

Commit

Permalink
Merge pull request #119 from alphagov/dependabot/bundler/rubocop-govu…
Browse files Browse the repository at this point in the history
…k-eq-5.0.1

Update rubocop-govuk requirement from = 4.18.0 to = 5.0.1
  • Loading branch information
yndajas authored Jul 1, 2024
2 parents 283a6ff + a33bd25 commit b54094d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion govuk_message_queue_consumer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "pry-byebug"
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 3.11"
s.add_development_dependency "rubocop-govuk", "4.18.0"
s.add_development_dependency "rubocop-govuk", "5.0.1"
s.add_development_dependency "yard"
end
4 changes: 2 additions & 2 deletions spec/govuk_message_queue_consumer/consumer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
describe GovukMessageQueueConsumer::Consumer do
include QueueHelpers

let(:logger) { instance_double("Logger") }
let(:client_processor) { instance_double("Client::Processor") }
let(:logger) { double }
let(:client_processor) { double }

describe "#run" do
let(:stubs) { create_bunny_stubs }
Expand Down
15 changes: 11 additions & 4 deletions spec/govuk_message_queue_consumer/heartbeat_processor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
require "spec_helper"

describe GovukMessageQueueConsumer::HeartbeatProcessor do
let(:heartbeat_headers) { instance_double("Heartbeat Headers", content_type: "application/x-heartbeat") }
let(:heartbeat_message) { instance_double("Heartbeat Message", headers: heartbeat_headers, ack: nil) }
let(:standard_headers) { instance_double("Standard Headers", content_type: nil) }
let(:standard_message) { instance_double("Standard Message", headers: standard_headers, ack: nil) }
let(:heartbeat_headers) { double }
let(:heartbeat_message) { double }
let(:standard_headers) { double }
let(:standard_message) { double }

before do
allow(heartbeat_headers).to receive(:content_type).and_return("application/x-heartbeat")
allow(heartbeat_message).to receive_messages(headers: heartbeat_headers, ack: nil)
allow(standard_headers).to receive(:content_type).and_return(nil)
allow(standard_message).to receive_messages(headers: standard_headers, ack: nil)
end

context "when receiving heartbeat message" do
it "doesn't call the next processor" do
Expand Down
10 changes: 7 additions & 3 deletions spec/govuk_message_queue_consumer/message_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require "spec_helper"

describe GovukMessageQueueConsumer::Message do
let(:mock_channel) { instance_double("Channel") }
let(:delivery_info) { instance_double("DeliveryInfo", channel: mock_channel, delivery_tag: "a_tag") }
let(:headers) { instance_double("Headers") }
let(:mock_channel) { double }
let(:delivery_info) { double }
let(:headers) { double }
let(:message) { described_class.new({ "a" => "payload" }, headers, delivery_info) }

before do
allow(delivery_info).to receive_messages(channel: mock_channel, delivery_tag: "a_tag")
end

it "ack sends an ack to the channel" do
expect(mock_channel).to receive(:ack).with("a_tag")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "spec_helper"
require "govuk_message_queue_consumer/test_helpers"

describe GovukMessageQueueConsumer::MockMessage do # rubocop:disable RSpec/FilePath
describe GovukMessageQueueConsumer::MockMessage do # rubocop:disable RSpec/SpecFilePathFormat
describe "#methods" do
it "implements the same methods as Message" do
mock = described_class.new
Expand Down
6 changes: 3 additions & 3 deletions spec/support/queue_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ def create_bunny_stubs
end

def create_connection(channel)
instance_double("Bunny::Session", start: nil, create_channel: channel)
instance_double(Bunny::Session, start: nil, create_channel: channel)
end

def create_channel(queue)
instance_double("Bunny::Channel", queue:, prefetch: nil, topic: nil)
instance_double(Bunny::Channel, queue:, prefetch: nil, topic: nil)
end

def create_queue
instance_double("Bunny::Queue", bind: nil, subscribe: "")
instance_double(Bunny::Queue, bind: nil, subscribe: "")
end

class BunnyStubs
Expand Down

0 comments on commit b54094d

Please sign in to comment.