Skip to content
This repository
Newer
Older
100644 18 lines (14 sloc) 0.554 kb
4a60730a »
2010-03-13 Added stubs for missing methods under 1.9.
1 require File.expand_path('../../../spec_helper', __FILE__)
2
c1a4be4e »
2011-10-02 Specs for Array#take, #take_while
3 ruby_version_is "1.8.7" do
4a60730a »
2010-03-13 Added stubs for missing methods under 1.9.
4 describe "Array#take_while" do
fb75becc »
2011-11-29 Some cleanup for Array#take, #take_while.
5 it "returns all elements until the block returns false" do
c1a4be4e »
2011-10-02 Specs for Array#take, #take_while
6 [1, 2, 3].take_while{ |element| element < 3 }.should == [1, 2]
7 end
fb75becc »
2011-11-29 Some cleanup for Array#take, #take_while.
8
9 it "returns all elements until the block returns nil" do
10 [1, 2, nil, 4].take_while{ |element| element }.should == [1, 2]
c1a4be4e »
2011-10-02 Specs for Array#take, #take_while
11 end
c652ddb3 »
2011-11-29 Cleaned up fixes from tapajos.
12
13 it "returns all elements until the block returns false" do
14 [1, 2, false, 4].take_while{ |element| element }.should == [1, 2]
15 end
4a60730a »
2010-03-13 Added stubs for missing methods under 1.9.
16 end
17 end
Something went wrong with that request. Please try again.