Sha256: 4dbe13a4aa57ac588efc9d0c3520309dd94ff0f08d7336fef686d525beea3bde

Contents?: true

Size: 652 Bytes

Versions: 5

Compression:

Stored size: 652 Bytes

Contents

require 'spec_helper'

describe Monolens, 'object.allbut' do
  subject do
    Monolens.lens('object.allbut' => { defn: [ :lastname, :city ] })
  end

  it 'works as expected' do
    input = {
      'firstname' => 'Bernard',
      'lastname' => 'Lambeau',
      'city' => 'Brussels'
    }
    expected = {
      'firstname' => 'Bernard',
    }
    expect(subject.call(input)).to eql(expected)
  end

  it 'works as expected with Symbol keys' do
    input = {
      firstname: 'Bernard',
      lastname: 'Lambeau',
      city: 'Brussels'
    }
    expected = {
      firstname: 'Bernard',
    }
    expect(subject.call(input)).to eql(expected)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
monolens-0.6.4 spec/monolens/stdlib/object/test_allbut.rb
monolens-0.6.3 spec/monolens/stdlib/object/test_allbut.rb
monolens-0.6.2 spec/monolens/stdlib/object/test_allbut.rb
monolens-0.6.1 spec/monolens/stdlib/object/test_allbut.rb
monolens-0.6.0 spec/monolens/stdlib/object/test_allbut.rb