Sha256: 37154938b34ff8331bbb8ecda3a92309cc987b2cafae91ed2431a1c9dcd21712

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

require 'spec_helper'

describe Glman::InitRequired do

  class TestInitRequiredClass
    include Glman::InitRequired

    attr_required :a
  end

  it 'Test class should have propery a' do
    subject = TestInitRequiredClass.new(a: 'test')
    subject.a.should eq 'test'
  end

  it 'should raise InitializationError when required attr missing on initialization' do
    -> { TestInitRequiredClass.new }.should raise_error
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
glman-0.1.3 spec/glman/init_required_spec.rb
glman-0.1.2 spec/glman/init_required_spec.rb
glman-0.1.1 spec/glman/init_required_spec.rb
glman-0.1.0 spec/glman/init_required_spec.rb