Sha256: d671d774bdc9448d886e5ea7f8c7bc4350a10c694607c13b4a81fbaa29cc46ad

Contents?: true

Size: 459 Bytes

Versions: 3

Compression:

Stored size: 459 Bytes

Contents

require "spec_helper"
require "hamster/list"

describe Hamster::List do
  describe "#<<" do
    it "adds an item onto the end of a list" do
      list = L["a", "b"]
      (list << "c").should eql(L["a", "b", "c"])
      list.should eql(L["a", "b"])
    end

    context "on an empty list" do
      it "returns a list with one item" do
        list = L.empty
        (list << "c").should eql(L["c"])
        list.should eql(L.empty)
      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/ltlt_spec.rb
hamster-3.0.0 spec/lib/hamster/list/ltlt_spec.rb
hamster-2.0.0 spec/lib/hamster/list/ltlt_spec.rb