ultravisor/spec/ultravisor/child/cast_spec.rb in service_skeleton-2.1.0 vs ultravisor/spec/ultravisor/child/cast_spec.rb in service_skeleton-2.2.0
- old
+ new
@@ -104,8 +104,32 @@
it "does not explode if the instance is dying" do
instance.instance_variable_get(:@ultravisor_child_castcall_queue).close
expect { child.cast.to_s }.to_not raise_error
end
+
+ context "with keyword arguments" do
+ class Child
+ def run
+ end
+
+ def process
+ process_castcall
+ end
+
+ def kwarg(message:)
+ raise "#{message} was passed"
+ end
+ end
+
+ let(:args) do
+ { id: :child, klass: Child, method: :run, enable_castcall: true, access: :unsafe }
+ end
+
+ it "forwards them" do
+ child.cast.kwarg(message: "hey")
+ expect { child.unsafe_instance.process }.to raise_error("hey was passed")
+ end
+ end
end
end
end