Sha256: 02239cd356b8753caf2f07db6d2a93f4e554642fddb27ada59b6f1ca28ad1b04

Contents?: true

Size: 1.36 KB

Versions: 16

Compression:

Stored size: 1.36 KB

Contents

# -*- encoding : utf-8 -*-
require 'mdwa/dsl'

require 'minitest/spec'
require 'minitest/autorun'

describe MDWA::DSL::Entity do
  
  before do 
    MDWA::DSL.requirements.register do |r|
      r.summary = 'Manage Projects'

      r.description = %q{Detailed description of the requirement.}
      r.entities    = ['ProjectGroup', 'Project', 'Task', 'Milestone']
      r.users       = ['Administrator', 'TeamMember']
    end
    
    MDWA::DSL.requirements.register 'Manage clients' do |r|
      r.alias = 'clients'
    end
  end
  
  it 'should store data correctly' do
    
    requirement = MDWA::DSL.requirement('manage_projects')
    requirement.summary.must_equal 'Manage Projects'
    requirement.description.must_equal 'Detailed description of the requirement.'
    requirement.entities.count.must_equal 4
    requirement.entities[0].must_equal 'ProjectGroup'
    requirement.entities[1].must_equal 'Project'
    requirement.entities[2].must_equal 'Task'
    requirement.entities[3].must_equal 'Milestone'
    requirement.users.count.must_equal 2
    requirement.users[0].must_equal 'Administrator'
    requirement.users[1].must_equal 'TeamMember'
    
    requirement_client = MDWA::DSL.requirement('clients')
    requirement_client.nil?.must_equal false
    requirement_client.summary.must_equal 'Manage clients'
    requirement_client.alias.must_equal 'clients'
    
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mdd-3.1.0 test/requirements_test.rb
mdd-3.0.20 test/requirements_test.rb
mdd-3.0.19 test/requirements_test.rb
mdd-3.0.18 test/requirements_test.rb
mdd-3.0.17 test/requirements_test.rb
mdd-3.0.16 test/requirements_test.rb
mdd-3.0.15 test/requirements_test.rb
mdd-3.0.14 test/requirements_test.rb
mdd-3.0.13 test/requirements_test.rb
mdd-3.0.10 test/requirements_test.rb
mdd-3.0.9 test/requirements_test.rb
mdd-3.0.8 test/requirements_test.rb
mdd-3.0.7 test/requirements_test.rb
mdd-3.0.6 test/requirements_test.rb
mdd-3.0.4 test/requirements_test.rb
mdd-3.0.3 test/requirements_test.rb