Sha256: d45fc0a5d1514ab6a68b5102a4b4d63bf50b66887b276585931a61575a940f5c
Contents?: true
Size: 861 Bytes
Versions: 4
Compression:
Stored size: 861 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/list' describe Hamster::List do describe "#inspect" do describe "doesn't run out of stack space on a really big" do it "stream" do @list = Hamster.interval(0, STACK_OVERFLOW_DEPTH) end it "list" do @list = (0...STACK_OVERFLOW_DEPTH).reduce(Hamster.list) { |list, i| list.cons(i) } end after do @list.inspect end end [ [[], "[]"], [["A"], "[\"A\"]"], [["A", "B", "C"], "[\"A\", \"B\", \"C\"]"] ].each do |values, expected| describe "on #{values.inspect}" do before do @list = Hamster.list(*values) end it "returns #{expected.inspect}" do @list.inspect.should == expected end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems