Sha256: d1232c3e397a73a3ecbe12aa19b98efd680558ff9c4d2537694e83b3bbe6e90b

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:abstract_type) do
    Class.new do
      include AbstractType

      abstract_method :some_method
    end
  end

  let(:class_under_test)do
    Class.new(abstract_type) do
      def self.name; 'TheClassName'; end
    end
  end

  let(:object) { class_under_test.new }

  it 'creates an abstract method' do
    expect { subject }.to raise_error(NotImplementedError,'TheClassName#some_method is not implemented')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abstract_type-0.0.1 spec/unit/abstract_type/class_methods/abstract_method_spec.rb