spec/integration/auto_injection_spec.rb in dry-transaction-0.11.2 vs spec/integration/auto_injection_spec.rb in dry-transaction-0.12.0

- old
+ new

@@ -1,32 +1,32 @@ -require "dry-monads" -require "dry-auto_inject" +# require "dry-monads" +# require "dry-auto_inject" -RSpec.describe "Using dry-auto_inject" do - let(:transaction) { - Class.new do - include Dry::Transaction(container: Test::Container) - include Test::Inject[:extract_email] +# RSpec.describe "Using dry-auto_inject" do +# let(:transaction) { +# Class.new do +# include Dry::Transaction(container: Test::Container) +# include Test::Inject[:extract_email] - step :symbolize +# step :symbolize - def call(input) - super(input).bind(extract_email) - end - end.new - } +# def call(input) +# super(input).bind(extract_email) +# end +# end.new +# } - before do - module Test - Container = { - symbolize: -> input { Dry::Monads::Right(name: input["name"], email: input["email"]) }, - extract_email: -> input { Dry::Monads::Right(email: input[:email]) }, - } +# before do +# module Test +# Container = { +# symbolize: -> input { Dry::Monads::Right(name: input["name"], email: input["email"]) }, +# extract_email: -> input { Dry::Monads::Right(email: input[:email]) }, +# } - Inject = Dry::AutoInject(container: Container) - end - end +# Inject = Dry::AutoInject(container: Container) +# end +# end - it "support auto-injection of dependencies alongside step operations" do - expect(transaction.("name" => "Jane", "email" => "jane@example.com").value).to eq(email: "jane@example.com") - end -end +# it "support auto-injection of dependencies alongside step operations" do +# expect(transaction.("name" => "Jane", "email" => "jane@example.com").value).to eq(email: "jane@example.com") +# end +# end