Sha256: 31a367136b30fbf0b329d3617daa2dd12669b0132eaf325208c7963186528610

Contents?: true

Size: 564 Bytes

Versions: 4

Compression:

Stored size: 564 Bytes

Contents

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

describe Hamster::Set do

  [:include?, :member?].each do |method|

    describe "##{method}" do

      before do
        @set = Hamster.set("A", "B", "C", nil)
      end

      ["A", "B", "C", nil].each do |value|

        it "returns true for an existing value (#{value.inspect})" do
          @set.send(method, value).should be_true
        end

      end

      it "returns false for a non-existing value" do
        @set.send(method, "D").should be_false
      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hamster-0.1.14 spec/hamster/set/include_spec.rb
hamster-0.1.13 spec/hamster/set/include_spec.rb
hamster-0.1.12 spec/hamster/set/include_spec.rb
hamster-0.1.11 spec/hamster/set/include_spec.rb