Sha256: e9633683474f7df7c6126af8b56fd3642307f7d5be7e8038107cf19de0a06026

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require 'MonkeyFactory'

describe 'MonkeyFactory' do
  before(:all) do
  end

  after(:all) do
  end

  context 'create' do
    it 'should instantiate an object from the factory' do
      monkey = MonkeyFactory.create(:harpo)
      monkey.nil?.should == false
      monkey.is_a?(Monkey).should == true
    end

    it 'should not instantiate an object without using the factory' do
      -> { Monkey.new :groucho }.should raise_error NoMethodError
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
MonkeyEngine-2.0.0 spec/monkey_factory_spec.rb