Skip to content

Commit

Permalink
Fix RBS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Jul 22, 2024
1 parent f632e7d commit 6ea2e9d
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 72 deletions.
30 changes: 15 additions & 15 deletions codegen/projections/rails_json/sig/rails_json/config.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/projections/rails_json/sig/rails_json/endpoint.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions codegen/projections/rpcv2_cbor/sig/rpcv2_cbor/config.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/projections/rpcv2_cbor/sig/rpcv2_cbor/endpoint.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/projections/white_label/sig/white_label/client.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions codegen/projections/white_label/sig/white_label/config.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions codegen/projections/white_label/sig/white_label/endpoint.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/projections/white_label/spec/auth_spec.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions codegen/projections/white_label/spec/client_spec.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions codegen/projections/white_label/spec/compression_spec.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/projections/white_label/spec/config_spec.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public List<AuthScheme> getAdditionalAuthSchemes(GenerationContext context) {
identityType,
HttpBasicAuthTrait.ID))
.documentationType(Hearth.IDENTITY_PROVIDER.toString())
.rbsType(Hearth.IDENTITY_PROVIDER.toString())
.defaultDynamicValue(defaultConfigValue)
.constraint(new TypeConstraint(Hearth.IDENTITY_PROVIDER.toString()))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module Auth
end

describe Config do
it 'validates identity resolvers' do
it 'validates identity resolvers', rbs_test: :skip do
msg = /to be in \[Hearth::IdentityProvider\], got String/
expect do
Config.new(http_api_key_provider: 'foo').validate!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module WhiteLabel
client.kitchen_sink
end

it 'validates config' do
it 'validates config', rbs_test: :skip do
expect do
Client.new(stub_responses: 'false')
end.to raise_error(ArgumentError, /config\[:stub_responses\]/)
Expand All @@ -34,7 +34,7 @@ module WhiteLabel
expect(client.config.logger).to eq(logger)
end

it 'validates global config values' do
it 'validates global config values', rbs_test: :skip do
Hearth.config[:logger] = 'logger'
expect do
Client.new
Expand All @@ -50,7 +50,7 @@ module WhiteLabel
end

context 'operation overrides' do
it 'validates config' do
it 'validates config', rbs_test: :skip do
expect do
client.kitchen_sink({}, endpoint: 1)
end.to raise_error(ArgumentError, /config\[:endpoint\]/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module WhiteLabel
describe Config do
context 'disable_request_compression' do
it 'raises error when given an invalid input' do
it 'raises when given an invalid input', rbs_test: :skip do
expect { Config.new(disable_request_compression: 'string').validate! }
.to raise_error(
ArgumentError,
Expand All @@ -16,7 +16,7 @@ module WhiteLabel
end

context 'request_min_compression_size_bytes' do
it 'raises error when given invalid integer' do
it 'raises when given invalid integer' do
expect { Config.new(request_min_compression_size_bytes: -1).validate! }
.to raise_error(
ArgumentError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module WhiteLabel
expect(config.request_min_compression_size_bytes).to be_a(Integer)
end

it 'validates types' do
it 'validates types', rbs_test: :skip do
config = Config.new(logger: 'foo')
expect { config.validate! }
.to raise_error(ArgumentError, /config\[:logger\]/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void renderRbs() {
clientConfigList.forEach((clientConfig) -> {
String member = RubySymbolProvider.toMemberName(clientConfig.getName());
String rbsType = clientConfig.getRbsType();
writer.write("attr_accessor $L (): $L", member, rbsType);
writer.write("attr_accessor $L (): $L?", member, rbsType);
});
})
.write("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void renderRbsEndpointParamsClass(RubyCodeWriter writer) {
.collect(Collectors.joining(", ")))
.call(() -> {
paramsToTypes.forEach((param, rbsType) -> {
writer.write("attr_accessor $L (): $L", param, rbsType);
writer.write("attr_accessor $L (): $L?", param, rbsType);
});
})
.closeBlock("end");
Expand Down

0 comments on commit 6ea2e9d

Please sign in to comment.