Sha256: b4c316a0309f0f04844670ddddae6c5aa0507fce548ecd664c840504af6902bf

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Hamster::List do

  describe "#drop" do

    [
      [[], 10, []],
      [["A"], 10, []],
      [["A"], -1, ["A"]],
      [["A", "B", "C"], 0, ["A", "B", "C"]],
      [["A", "B", "C"], 2, ["C"]],
    ].each do |values, number, result|

      describe "#{number} from #{values.inspect}" do

        list = Hamster.list(*values)

        it "returns #{result}" do
          list.drop(number).should == Hamster.list(*result)
        end

      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hamster-0.1.12 spec/hamster/list/drop_spec.rb
hamster-0.1.11 spec/hamster/list/drop_spec.rb