Sha256: 963ac174ca0fd885558dd07478d5e15b45b23b964647688fd18c2a4a331c715d

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

# encoding: utf-8

require "transproc/rspec"

describe AbstractMapper::Functions, "#filter" do

  let(:arguments) { [:filter, -> v { v - 1 if v > 3 }] }

  it_behaves_like :transforming_immutable_data do
    let(:input)  { [] }
    let(:output) { [] }
  end

  it_behaves_like :transforming_immutable_data do
    let(:input)  { [1, 4, 9, 7, 2, 5] }
    let(:output) { [3, 8, 6, 4]       }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:filter, -> v { [v - 1] if v > 3 }] }

    let(:input)  { [1, 4, 9, 7, 2, 5] }
    let(:output) { [3, 8, 6, 4]       }
  end

end # describe AbstractMapper::Functions#filter

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abstract_mapper-0.0.2 spec/unit/abstract_mapper/functions/filter_spec.rb