Skip to content

Commit b8c435a

Browse files
CopilotGrantBirki
andcommitted
Fix final tests and linting issues for snake_case handlers
Co-authored-by: GrantBirki <[email protected]>
1 parent 2558857 commit b8c435a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/unit/lib/hooks/core/config_validator_security_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
it "rejects dangerous system class names" do
2828
dangerous_configs = Hooks::Security::DANGEROUS_CLASSES.map do |class_name|
2929
# Convert PascalCase to snake_case for config
30-
snake_case_name = class_name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
30+
snake_case_name = class_name.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, "")
3131
{ path: "/webhook", handler: snake_case_name }
3232
end
3333

spec/unit/lib/hooks/core/plugin_loader_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ def call(payload:, headers:, env:, config:)
163163
end
164164

165165
it "returns built-in handler plugins" do
166-
expect(described_class.get_handler_plugin("DefaultHandler")).to eq(DefaultHandler)
166+
expect(described_class.get_handler_plugin("default_handler")).to eq(DefaultHandler)
167167
end
168168

169169
it "raises error for non-existent plugin" do
170-
expect { described_class.get_handler_plugin("NonExistentHandler") }.to raise_error(
171-
StandardError, /Handler plugin 'NonExistentHandler' not found/
170+
expect { described_class.get_handler_plugin("non_existent_handler") }.to raise_error(
171+
StandardError, /Handler plugin 'non_existent_handler' not found/
172172
)
173173
end
174174
end

0 commit comments

Comments
 (0)