Sha256: 7ee8f3ba885bf4d1aac24a27865974997f83d91d5cbd13b9054c081995d6d1ec

Contents?: true

Size: 299 Bytes

Versions: 5

Compression:

Stored size: 299 Bytes

Contents

describe Array do
  it '#duplicates' do
    expect([1, 2, 3, 4].duplicates).to be_empty
    expect([1, 2, 3, 4, 2, 4].duplicates).to match_array [2, 4]

    expect(['1', '2', '3', '4'].duplicates).to be_empty
    expect(['1', '2', '3', '4', '2', '4'].duplicates).to match_array ['2', '4']
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
more_core_extensions-3.2.0 spec/core_ext/array/duplicates_spec.rb
more_core_extensions-3.1.1 spec/core_ext/array/duplicates_spec.rb
more_core_extensions-3.1.0 spec/core_ext/array/duplicates_spec.rb
more_core_extensions-3.0.0 spec/core_ext/array/duplicates_spec.rb
more_core_extensions-2.0.0 spec/core_ext/array/duplicates_spec.rb