Sha256: c6355fdaf5f229dd72c59761a1a18a63a48b91f36205d4f89353fb38226ea5f8

Contents?: true

Size: 486 Bytes

Versions: 3

Compression:

Stored size: 486 Bytes

Contents

require "spec_helper"
require "hamster/list"

describe Hamster::List do
  let(:list) { L[*values] }

  describe "#pop" do
    let(:pop) { list.pop }

    context "with an empty list" do
      let(:values) { [] }

      it "returns an empty list" do
        expect(pop).to eq(L.empty)
      end
    end

    context "with a list with a few items" do
      let(:values) { %w[a b c] }

      it "removes the last item" do
        expect(pop).to eq(L["a", "b"])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hamster-3.0.0/spec/lib/hamster/list/pop_spec.rb
hamster-3.0.0 spec/lib/hamster/list/pop_spec.rb
hamster-2.0.0 spec/lib/hamster/list/pop_spec.rb