Sha256: 2e4d87a3321d50f2e101dc589d568b87b3c8b8cb32adf9042045e2072e29f873

Contents?: true

Size: 514 Bytes

Versions: 5

Compression:

Stored size: 514 Bytes

Contents

require 'spec_helper'

describe Monolens, 'array.compact' do
  subject do
    Monolens.lens('array.compact')
  end

  it 'removes nils' do
    expect(subject.call([nil, 'notnil'])).to eql(['notnil'])
  end

  it 'supports empty arrays' do
    expect(subject.call([])).to eql([])
  end

  describe 'signature checking' do
    it 'detects unexisting options' do
      expect {
        Monolens.lens('array.compact' => { foo: 'bar' })
      }.to raise_error(Monolens::Error, /Invalid option `foo`/)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
monolens-0.6.4 spec/monolens/stdlib/array/test_compact.rb
monolens-0.6.3 spec/monolens/stdlib/array/test_compact.rb
monolens-0.6.2 spec/monolens/stdlib/array/test_compact.rb
monolens-0.6.1 spec/monolens/stdlib/array/test_compact.rb
monolens-0.6.0 spec/monolens/stdlib/array/test_compact.rb