Sha256: bc844228a2ac047adb0137352883917750b09ee465ee47d928cb1fdc6b248cdf

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

require 'spec_helper'

describe Array do

  describe "#uniq?" do
    context "when the Array is empy" do
      it "should return true" do
        [].uniq?.should be_true
      end
    end
    context "when the Array has only one item" do
      it "should return true" do
        [1].uniq?.should be_true
      end
    end
    context "when the Array has unique items" do
      it "should return true" do
        [1, 2, 3, 4].uniq?.should be_true
      end
    end
    context "when the Array has more than one the same item" do
      it "should return false" do
        [1, 2, 3, 1].uniq?.should be_false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
array_is_uniq-0.0.1 spec/array_is_uniq/array_spec.rb