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

Version Path
auser-poolparty-1.1.6 test/poolparty/core/array_test.rb
auser-poolparty-1.1.7 test/poolparty/core/array_test.rb
auser-poolparty-1.2.0 test/poolparty/core/array_test.rb
auser-poolparty-1.2.1 test/poolparty/core/array_test.rb
auser-poolparty-1.2.10 test/poolparty/core/array_test.rb
auser-poolparty-1.2.11 test/poolparty/core/array_test.rb
auser-poolparty-1.2.2 test/poolparty/core/array_test.rb
auser-poolparty-1.2.3 test/poolparty/core/array_test.rb
auser-poolparty-1.2.4 test/poolparty/core/array_test.rb
auser-poolparty-1.2.7 test/poolparty/core/array_test.rb
auser-poolparty-1.2.8 test/poolparty/core/array_test.rb
auser-poolparty-1.2.9 test/poolparty/core/array_test.rb
fairchild-poolparty-1.1.5 test/poolparty/core/array_test.rb
poolparty-1.2.2 test/poolparty/core/array_test.rb