Sha256: 7738be76b5b4ab73ad3ba1d684aabbe1e9b2331fd11d903ae7bca428d82a4ae0

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'inactive_support/array'

describe Array do

  describe '#butfirst' do
    it 'returns all elements excluding the first one' do
      expect([].butfirst).to eq []
      expect([1].butfirst).to eq []
      expect([1, 2, 3].butfirst).to eq [2, 3]
      expect([1, 2, 3, 4].butfirst).to eq [2, 3, 4]
    end
  end

  describe '#butlast' do
    it 'returns all elements excluding the last one' do
      expect([].butlast).to eq []
      expect([1].butlast).to eq []
      expect([1, 2, 3].butlast).to eq [1, 2]
      expect([1, 2, 3, 4].butlast).to eq [1, 2, 3]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inactive_support-1.3.0 spec/lib/array_spec.rb
inactive_support-1.2.0 spec/lib/array_spec.rb