File: drop_last_while_spec.rb

package info (click to toggle)
ruby-powerpack 0.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 492 kB
  • sloc: ruby: 819; makefile: 3
file content (9 lines) | stat: -rw-r--r-- 264 bytes parent folder | download
1
2
3
4
5
6
7
8
9
require 'spec_helper'

unless Enumerable.method_defined? :drop_last_while
  describe 'Enumerable#drop_last_while' do
    it 'drops the last elements while a pred is true' do
      expect([1, 2, 3, 4, 6].drop_last_while(&:even?)).to eq([1, 2, 3])
    end
  end
end