Sha256: a49ed40152e952d155803822f782b1e1aad12bd4e378fe74319a30c214c4e621

Contents?: true

Size: 516 Bytes

Versions: 5

Compression:

Stored size: 516 Bytes

Contents

RSpec.describe Dry::Transaction::StepAdapters::Map do

  subject { described_class.new }

  let(:operation) {
    -> (input) { input.upcase }
  }

  let(:step) {
    Dry::Transaction::Step.new(subject, :step, :step, operation, {})
  }

  describe "#call" do

    it "return a Right Monad" do
      expect(subject.call(step, 'input')).to be_a Dry::Monads::Either::Right
    end

    it "return the result of the operation as output" do
      expect(subject.call(step, 'input').value).to eql 'INPUT'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-transaction-0.10.2 spec/unit/step_adapters/map_spec.rb
dry-transaction-0.10.1 spec/unit/step_adapters/map_spec.rb
dry-transaction-0.10.0 spec/unit/step_adapters/map_spec.rb
dry-transaction-0.9.0 spec/unit/step_adapters/map_spec.rb
dry-transaction-0.8.0 spec/unit/step_adapters/map_spec.rb