Sha256: bb2152e1a425505bc613c60a8fc5bb59056cd4fdffd43cf2d58c54cfce3ea803

Contents?: true

Size: 452 Bytes

Versions: 76

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHS::Collection do
  let(:data) do
    [1, 2, 3]
  end

  let(:collection) do
    LHS::Collection.new(LHS::Data.new(data))
  end

  context 'enumerable' do
    it 'works with map' do
      expect(
        collection.map { |x| x + 1 }
      ).to eq [2, 3, 4]
    end

    it 'works with select' do
      expect(
        collection.select { |x| x == 2 }
      ).to eq [2]
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/collection/enumerable_spec.rb
lhs-26.1.0 spec/collection/enumerable_spec.rb
lhs-26.0.1 spec/collection/enumerable_spec.rb
lhs-26.0.0 spec/collection/enumerable_spec.rb
lhs-25.2.0 spec/collection/enumerable_spec.rb
lhs-25.1.0 spec/collection/enumerable_spec.rb
lhs-25.0.4 spec/collection/enumerable_spec.rb
lhs-25.0.3 spec/collection/enumerable_spec.rb
lhs-25.0.2 spec/collection/enumerable_spec.rb
lhs-25.0.1 spec/collection/enumerable_spec.rb
lhs-25.0.0 spec/collection/enumerable_spec.rb
lhs-24.1.2 spec/collection/enumerable_spec.rb
lhs-24.1.1 spec/collection/enumerable_spec.rb
lhs-24.1.0 spec/collection/enumerable_spec.rb
lhs-24.1.0.pre.2 spec/collection/enumerable_spec.rb
lhs-24.1.0.pre.1 spec/collection/enumerable_spec.rb
lhs-24.0.0 spec/collection/enumerable_spec.rb
lhs-23.0.2 spec/collection/enumerable_spec.rb
lhs-23.0.1 spec/collection/enumerable_spec.rb
lhs-23.0.0 spec/collection/enumerable_spec.rb