Skip to content

Commit

Permalink
Migrate to new tucana protocol names
Browse files Browse the repository at this point in the history
  • Loading branch information
Taucher2003 committed Dec 16, 2024
1 parent b5a5a20 commit e2ee53c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/grpc/ping_handler.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true

class PingHandler < Tucana::Internal::PingService::Service
class PingHandler < Tucana::Sagittarius::PingService::Service
include GrpcHandler

def ping(request, _call)
Tucana::Internal::PingMessage.new(ping_id: request.ping_id)
Tucana::Sagittarius::PingMessage.new(ping_id: request.ping_id)
end
end
2 changes: 1 addition & 1 deletion config/initializers/tucana.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

Rails.application.config.to_prepare do
Tucana.load_protocol(:internal)
Tucana.load_protocol(:sagittarius)
end
2 changes: 1 addition & 1 deletion spec/grpc/ping_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
subject(:handler) { described_class.new }

describe '.ping' do
let(:message) { Tucana::Internal::PingMessage.new(ping_id: 1) }
let(:message) { Tucana::Sagittarius::PingMessage.new(ping_id: 1) }

it 'returns message with same id' do
expect(handler.ping(message, nil).ping_id).to eq(message.ping_id)
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/grpc/internal/ping_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# frozen_string_literal: true

RSpec.describe 'internal.PingService', :need_grpc_server do
RSpec.describe 'sagittarius.PingService', :need_grpc_server do
include GrpcHelpers

let(:stub) { create_stub Tucana::Internal::PingService }
let(:stub) { create_stub Tucana::Sagittarius::PingService }

describe 'Ping' do
it 'returns the same ping id' do
message = Tucana::Internal::PingMessage.new(ping_id: 42)
message = Tucana::Sagittarius::PingMessage.new(ping_id: 42)
expect(stub.ping(message, authorization).ping_id).to eq(message.ping_id)
end
end
Expand Down

0 comments on commit e2ee53c

Please sign in to comment.