Sha256: 95571cc86ef18b2b5f7e2a4ef1d43fb88d3fee5142a91d6edff8c53e659d9769

Contents?: true

Size: 608 Bytes

Versions: 9

Compression:

Stored size: 608 Bytes

Contents

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

require 'hamster/set'

describe Hamster::Set do

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

    describe "##{method}" do

      [
        [[], nil],
        [["A"], "A"],
        [[1, 2, 3], 1],
      ].each do |values, expected|

        describe "on #{values.inspect}" do

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

          it "returns #{expected.inspect}" do
            @result.should == expected
          end

        end

      end

    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hamster-0.2.5 spec/hamster/set/head_spec.rb
hamster-0.2.4 spec/hamster/set/head_spec.rb
hamster-0.2.3 spec/hamster/set/head_spec.rb
hamster-0.2.2 spec/hamster/set/head_spec.rb
hamster-0.2.1 spec/hamster/set/head_spec.rb
hamster-0.2.0 spec/hamster/set/head_spec.rb
hamster-0.1.23 spec/hamster/set/head_spec.rb
hamster-0.1.22 spec/hamster/set/head_spec.rb
hamster-0.1.21 spec/hamster/set/head_spec.rb