Sha256: 3603cb4e0613a61a46a299ec1a18ed48ab19edcf1b036eeb6187122bb1ef32da
Contents?: true
Size: 775 Bytes
Versions: 7
Compression:
Stored size: 775 Bytes
Contents
require 'spec_helper' require 'hamster/stack' describe Hamster::Stack do describe "#to_ary" do describe "enables implicit conversion to" do before do @stack = Hamster.stack("D", "C", "B", "A") end it "block parameters" do def func(&block) yield(@stack) end func do |a, b, *c| a.should == "A" b.should == "B" c.should == ["C", "D"] end end it "method arguments" do def func(a, b, *c) a.should == "A" b.should == "B" c.should == ["C", "D"] end func(*@stack) end it "works with splat" do array = *@stack array.should == ["A", "B", "C", "D"] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems