Sha256: 87a9d9f423357561bd194b206a743138abc6d81193430aa63c1776e184aec53c

Contents?: true

Size: 720 Bytes

Versions: 9

Compression:

Stored size: 720 Bytes

Contents

require 'spec_helper'
require "set"

shared_examples_for "a collection" do
  let(:collection) { described_class.new([7, 2, 4]) }

  context "initialized with 3 items" do
    it "says it has three items" do
      expect(collection.size).to be 3
    end
  end

  describe "#include?" do
    context "with an an item that is in the collection" do
      it "returns true" do
        expect(collection.include?(7)).to be true
      end
    end

    context "with an an item that is not in the collection" do
      it "returns false" do
        expect(collection.include?(9)).to be false
      end
    end
  end
end

describe Array do
  it_behaves_like "a collection"
end

describe Set do
  it_behaves_like "a collection"
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
allure-rspec-0.8.0 spec/shared_example_spec.rb
allure-rspec-0.7.7 spec/shared_example_spec.rb
allure-rspec-0.7.6 spec/shared_example_spec.rb
allure-rspec-0.7.5 spec/shared_example_spec.rb
allure-rspec-0.7.4 spec/shared_example_spec.rb
allure-rspec-0.7.3 spec/shared_example_spec.rb
allure-rspec-0.7.1 spec/shared_example_spec.rb
allure-rspec-0.7.0 spec/shared_example_spec.rb
allure-rspec-0.6.9 spec/shared_example_spec.rb