Skip to content

Commit

Permalink
Handles empty firewall rule description - BR-2812
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaumont committed Sep 27, 2024
1 parent 9e1c006 commit 8921223
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- `cb info` now correctly handles firewall rules with an empty description.

## [3.6.0] - 2024-07-26
### Added
Expand Down
4 changes: 3 additions & 1 deletion spec/cb/firewall_rule_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ Spectator.describe FirewallRuleList do
}

it "outputs table with header" do
expect(client).to receive(:get_firewall_rules).and_return [Factory.firewall_rule(description: nil)]

action.call

expected = <<-EXPECTED
ID Rule Description
shofthj3fzaipie44lt6a5i3de 1.2.3.0/24 Example Description
shofthj3fzaipie44lt6a5i3de 1.2.3.0/24
EXPECTED

expect(&.output.to_s).to look_like expected
Expand Down
2 changes: 1 addition & 1 deletion src/models/firewall_rule.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module CB::Model
jrecord FirewallRule,
id : String,
description : String,
description : String?,
rule : String
end

0 comments on commit 8921223

Please sign in to comment.