Sha256: 4d3a217100ae10f04279d8334aa74146bb4742d6652dcaaa29623de2fbcf9442

Contents?: true

Size: 493 Bytes

Versions: 5

Compression:

Stored size: 493 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe AbstractType::ClassMethods, '#new' do
  subject { object.new }

  let(:abstract_type) { Class.new { include AbstractType } }

  context 'called on a subclass' do
    let(:object) { Class.new(abstract_type) }

    it { should be_instance_of(object) }
  end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
abstract_type-0.0.5 spec/unit/abstract_type/class_methods/new_spec.rb
abstract_type-0.0.4 spec/unit/abstract_type/class_methods/new_spec.rb
abstract_type-0.0.3 spec/unit/abstract_type/class_methods/new_spec.rb
abstract_type-0.0.2 spec/unit/abstract_type/class_methods/new_spec.rb
abstract_type-0.0.1 spec/unit/abstract_type/class_methods/new_spec.rb