Sha256: c63378ff72548a7af1d67b2c59f5277b74faa38f72cc482c58879c58b09bf8af

Contents?: true

Size: 403 Bytes

Versions: 5

Compression:

Stored size: 403 Bytes

Contents

# encoding: utf-8

shared_examples_for 'an abstract type' do
  context 'called on a subclass' do
    let(:object) { Class.new(described_class) }

    it { should be_instance_of(object) }
  end

  context 'called on the class' do
    let(:object) { described_class }

    specify do
      expect { subject }
        .to raise_error(NotImplementedError, "#{object} is an abstract type")
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
devtools-0.1.2 shared/spec/shared/abstract_type_behavior.rb
devtools-0.1.1 shared/spec/shared/abstract_type_behavior.rb
devtools-0.1.0 shared/spec/shared/abstract_type_behavior.rb
develry-0.0.3 shared/spec/shared/abstract_type_behavior.rb
develry-0.0.2 shared/spec/shared/abstract_type_behavior.rb