Sha256: 9aa8015587630342e8e96e63d990ecaec3507edf24675266d43b89b517086160

Contents?: true

Size: 833 Bytes

Versions: 4

Compression:

Stored size: 833 Bytes

Contents

RSpec::Matchers.define :have_topics do |topic_names|
  match { |bpmn_xml| topic_names.sort == bpmn_xml.topics.sort }
  failure_message { |bpmn_xml| "Expected #{topic_names}. Found #{bpmn_xml.topics.sort}" }
end

RSpec::Matchers.define :have_module do |module_name_expected|
  match { |bpmn_xml| module_name_expected == bpmn_xml.module_name }
  failure_message { |bpmn_xml| "ID of the BPMN process is #{bpmn_xml.module_name}. Expected #{module_name_expected}" }
end

RSpec::Matchers.define :have_defined_classes do
  missing_classes = []
  match do |bpmn_xml|
    missing_classes = bpmn_xml.modularized_class_names.reject(&:safe_constantize)
    missing_classes.empty?
  end
  failure_message do |_bpmn_xml|
    "#{missing_classes} are not defined. They are the expected classes in your Rails app to implement the workers."
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
camunda-workflow-0.1.3 lib/camunda/matchers.rb
camunda-workflow-0.1.2 lib/camunda/matchers.rb
camunda-workflow-0.1.1 lib/camunda/matchers.rb
camunda-workflow-0.1 lib/camunda/matchers.rb