File: butlast_spec.rb

package info (click to toggle)
ruby-powerpack 0.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 320 kB
  • ctags: 53
  • sloc: ruby: 727; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 236 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
require 'spec_helper'

describe 'Array#butlast' do
  it 'returns an array without the last element' do
    expect([1, 2, 3].butlast).to eq([1, 2])
  end

  it 'returns [] for empty lists' do
    expect([].butlast).to be_empty
  end
end