Sha256: 8d62962b492e522c55d60a58ad5dd5ae311f3d90c70f5c4dfe58af1a45380610

Contents?: true

Size: 496 Bytes

Versions: 2

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

require 'ostruct'

describe Transproc::ProcTransformations do
  describe '.bind' do
    let(:fn) { described_class.t(:bind, binding, proc) }
    let(:binding) { OpenStruct.new(prefix: prefix) }
    let(:proc) { -> v { [prefix, v].join('_') } }
    let(:prefix) { 'foo' }
    let(:input) { 'bar' }
    let(:output) { 'foo_bar' }

    subject  { fn[input] }

    it 'binds the given proc to the specified binding' do
      is_expected.to eq(output)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
transproc-1.1.1 spec/unit/proc_transformations_spec.rb
transproc-1.1.0 spec/unit/proc_transformations_spec.rb