Sha256: 5bcd9522800af70ca60b680cd90fe031b4d88a9e14f5f5f8792a2c49a4793e34
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'hamster/list' describe Hamster::List do [:include?, :member?].each do |method| describe "##{method}" 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.send(method, nil) end end [ [[], "A", false], [[], nil, false], [["A"], "A", true], [["A"], "B", false], [["A"], nil, false], [["A", "B", nil], "A", true], [["A", "B", nil], "B", true], [["A", "B", nil], nil, true], [["A", "B", nil], "C", false], ].each do |values, item, expected| describe "on #{values.inspect}" do before do @list = Hamster.list(*values) end it "returns #{expected.inspect}" do @list.send(method, item).should == expected end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hamster-0.1.21 | spec/hamster/list/include_spec.rb |
hamster-0.1.20 | spec/hamster/list/include_spec.rb |