Removed extension capsule

No longer needed now that we use exchanges which capture both the request, reponse, and any associated errors.

Issue: 261
Milestone: minor
This commit is contained in:
Brooke Kuhlmann
2026-04-22 13:40:24 -06:00
parent 669cb6fcbc
commit 4f76ef9630
2 changed files with 0 additions and 51 deletions
-18
View File
@@ -1,18 +0,0 @@
# frozen_string_literal: true
module Terminus
module Aspects
module Extensions
# A capsule of content and errors.
Capsule = Data.define :content, :errors do
def initialize content: {}, errors: {}
super
end
def clear = members.each { public_send(it).clear }
def errors? = errors.any?
end
end
end
end
@@ -1,33 +0,0 @@
# frozen_string_literal: true
require "hanami_helper"
RSpec.describe Terminus::Aspects::Extensions::Capsule do
subject(:capsule) { described_class.new }
describe "#initialize" do
it "answers defaults" do
expect(capsule).to eq(described_class[content: {}, errors: {}])
end
end
describe "#clear" do
it "clears all members" do
capsule = described_class[content: {a: 1}, errors: {"test" => "Danger!"}]
capsule.clear
expect(capsule).to eq(described_class.new)
end
end
describe "#errors?" do
it "answers true when errors exist" do
capsule.errors["test"] = "Danger!"
expect(capsule.errors?).to be(true)
end
it "answers false when errors don't exist" do
expect(capsule.errors?).to be(false)
end
end
end