Sha256: 75a19cad94ab93a8bebcd5bf180ce08800518d2cdb629a7f52665011c57261b8

Contents?: true

Size: 677 Bytes

Versions: 1

Compression:

Stored size: 677 Bytes

Contents

module OrigenTesters
  module SmartestBasedTester
    class Base
      module Processors
        # Removes any empty on_pass and on_fail branches
        class EmptyBranchCleaner < ATP::Processor
          # Delete any on-fail child if it's 'empty'
          def on_test(node)
            if on_pass = node.find(:on_pass)
              node = node.remove(on_pass) if on_pass.children.empty?
            end
            if on_fail = node.find(:on_fail)
              node = node.remove(on_fail) if on_fail.children.empty?
            end
            node = node.updated(nil, process_all(node.children))
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
origen_testers-0.13.2 lib/origen_testers/smartest_based_tester/base/processors/empty_branch_cleaner.rb