Sha256: 79bf830b2b177abc9471ee6508276c1003fff3e36d8bb9dbe3df4c8bd86304cd
Contents?: true
Size: 606 Bytes
Versions: 14
Compression:
Stored size: 606 Bytes
Contents
require "#{::File.dirname(__FILE__)}/../../test_helper" class TestWrappingArray < Test::Unit::TestCase context "wrapping_next" do setup do @array = %w(a b c d) end should "return element next in the chain" do @array.wrapping_next("a").should == "b" @array.wrapping_next("b").should == "c" @array.wrapping_next("c").should == "d" @array.wrapping_next("d").should == "a" @array.wrapping_next("a").should == "b" end should "raise if the element is not in the array" do lambda {@array.wrapping_next("z")}.should raise_error end end end
Version data entries
14 entries across 14 versions & 3 rubygems