Sha256: aac49b21e5af3f34248b9e67a5c876721f6a93d3a5f9940c70a429702fbd3f40
Contents?: true
Size: 853 Bytes
Versions: 6
Compression:
Stored size: 853 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/list' describe Hamster::List do describe "#inits" do it "is lazy" do lambda { Hamster.stream { fail }.inits }.should_not raise_error end [ [[], [[]]], [["A"], [[], ["A"]]], [["A", "B", "C"], [[], ["A"], ["A", "B"], ["A", "B", "C"]]], ].each do |values, expected| expected = expected.map { |x| Hamster.list(*x) } describe "on #{values.inspect}" do before do @original = Hamster.list(*values) @result = @original.inits 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