diff --git a/CHANGELOG.md b/CHANGELOG.md index 65081a9..41f19e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/spec/cb/firewall_rule_spec.cr b/spec/cb/firewall_rule_spec.cr index bb916ae..a757ba3 100644 --- a/spec/cb/firewall_rule_spec.cr +++ b/spec/cb/firewall_rule_spec.cr @@ -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 diff --git a/src/models/firewall_rule.cr b/src/models/firewall_rule.cr index 6a9dfdf..5036d43 100644 --- a/src/models/firewall_rule.cr +++ b/src/models/firewall_rule.cr @@ -1,6 +1,6 @@ module CB::Model jrecord FirewallRule, id : String, - description : String, + description : String?, rule : String end