Sha256: 03cef6703c4d0f9cfbb774b78cf30d7149381929a64cb2c2084ca21f7d4d1b45
Contents?: true
Size: 861 Bytes
Versions: 6
Compression:
Stored size: 861 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/list' describe Hamster::List do describe "#drop" do it "is lazy" do lambda { Hamster.stream { fail }.drop(1) }.should_not raise_error end [ [[], 10, []], [["A"], 10, []], [["A"], -1, ["A"]], [["A", "B", "C"], 0, ["A", "B", "C"]], [["A", "B", "C"], 2, ["C"]], ].each do |values, number, expected| describe "#{number} from #{values.inspect}" do before do @original = Hamster.list(*values) @result = @original.drop(number) end it "preserves the original" do @original.should == Hamster.list(*values) end it "returns #{expected.inspect}" do @result.should == Hamster.list(*expected) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems