Skip to content

Commit 06703b4

Browse files
author
Matt Muller
committed
Conditionally generate protocol spec
1 parent 60a4f36 commit 06703b4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

gems/smithy/lib/smithy/generators/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def spec_files
6767
Enumerator.new do |e|
6868
e.yield 'spec/spec_helper.rb', Views::Client::SpecHelper.new(@plan).render
6969
e.yield "spec/#{@gem_name}/endpoint_provider_spec.rb", Views::Client::EndpointProviderSpec.new(@plan).render
70-
e.yield "spec/#{@gem_name}/protocol_spec.rb", Views::Client::ProtocolSpec.new(@plan).render
70+
protocol_spec = Views::Client::ProtocolSpec.new(@plan)
71+
e.yield "spec/#{@gem_name}/protocol_spec.rb", protocol_spec.render unless protocol_spec.empty?
7172
end
7273
end
7374

gems/smithy/lib/smithy/views/client/protocol_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def vendor_code
3232
.reduce({}, :merge)
3333
end
3434

35+
def empty?
36+
@all_operation_tests.empty?
37+
end
38+
3539
# @api private
3640
class OperationTests
3741
def initialize(model, id, operation, vendor_code)

0 commit comments

Comments
 (0)