Sha256: 1920332a75acf8f5fb7dd1572f4e6da890dcc424eed19104653c0e51760f1c42

Contents?: true

Size: 936 Bytes

Versions: 15

Compression:

Stored size: 936 Bytes

Contents

# RSpec matcher for topic names used for testing bpmn files
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 matcher used for testing bpmn files
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

15 entries across 15 versions & 1 rubygems

Version Path
camunda-workflow-1.0.0 lib/camunda/matchers.rb
camunda-workflow-0.6.0 lib/camunda/matchers.rb
camunda-workflow-0.5.0 lib/camunda/matchers.rb
camunda-workflow-0.4.1 lib/camunda/matchers.rb
camunda-workflow-0.4.0 lib/camunda/matchers.rb
camunda-workflow-0.3.3 lib/camunda/matchers.rb
camunda-workflow-0.3.2 lib/camunda/matchers.rb
camunda-workflow-0.3.1 lib/camunda/matchers.rb
camunda-workflow-0.3.0 lib/camunda/matchers.rb
camunda-workflow-0.2.3 lib/camunda/matchers.rb
camunda-workflow-0.2.2 lib/camunda/matchers.rb
camunda-workflow-0.2.1 lib/camunda/matchers.rb
camunda-workflow-0.2.0 lib/camunda/matchers.rb
camunda-workflow-0.1.5 lib/camunda/matchers.rb
camunda-workflow-0.1.4 lib/camunda/matchers.rb