Sha256: 56430a504494e365976679f20e4263988269efbbd4983a952df6832bad45c5f9

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require "spec_helper"

require "hamster/set"

describe Hamster::Set do

  [:head, :first].each do |method|

    describe "##{method}" do

      describe "on an empty set" do

        before do
          @result = Hamster.set.send(method)
        end

        it "returns nil" do
          @returns.should be_nil
        end

      end

      describe "on a non-empty set" do

        before do
          @result = Hamster.set("A", "B", "C").send(method)
        end

        it "returns an arbitrary value from the set" do
          %w[A B C].should include(@result)
        end

      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hamster-1.0.1.pre.rc.1 spec/hamster/set/head_spec.rb