Sha256: ddf61f843eaa0cd35b727c662e4eebf16ba10b29bc517e7c5258d793a06d6a00

Contents?: true

Size: 798 Bytes

Versions: 6

Compression:

Stored size: 798 Bytes

Contents

shared_examples_for 'workflow' do |name|
  let(:obj){ send name }
  
  before(:each) do
    Cellect::Server.adapter.load_workflow obj.name
  end
  
  it 'should add singleton instances to the registry' do
    expect(obj.class[:foo]).to be_a_kind_of Cellect::Server::Workflow
    expect(obj.class[:foo].object_id).to eq obj.class[:foo].object_id
  end
  
  it 'should initialize empty' do
    expect(obj.name).to be_a String
    expect(obj.users).to be_a Hash
    
    set_klass = obj.prioritized? ? DiffSet::PrioritySet : DiffSet::RandomSet
    expect(obj.subjects).to be_a set_klass
  end
  
  it 'should provide a user lookup' do
    expect(obj.user(1)).to be_a Cellect::Server::User
    expect(obj.user(1).object_id).to eq obj.user(1).object_id
    expect(obj.users.keys).to include 1
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
cellect-client-0.1.0 spec/support/shared_examples_for_workflow.rb
cellect-server-0.1.0 spec/support/shared_examples_for_workflow.rb
cellect-client-0.0.9 spec/support/shared_examples_for_workflow.rb
cellect-server-0.0.9 spec/support/shared_examples_for_workflow.rb
cellect-client-0.0.8 spec/support/shared_examples_for_workflow.rb
cellect-server-0.0.8 spec/support/shared_examples_for_workflow.rb