Sha256: c8db0708840c1c31219dfbac55e0708891c89138fefd6e434a3b35e98a2b0269

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

module CukeIterations
  class ScenarioListGenerator
    class << self
      def for_iteration(scenarios, iteration_info)
        scenarios.select do |s|
          next if is_excluded?(s, iteration_info)
          is_included_by_tag?(s, iteration_info) || no_include_tags_specified?(iteration_info)
        end
      end

      def no_include_tags_specified?(iteration)
        iteration[:include_tags] == []
      end

      def is_included_by_tag?(scenario, iteration)
        (scenario[:tags] & iteration[:include_tags]).any?
      end

      def is_excluded?(scenario, iteration)
        (scenario[:tags] & iteration[:exclude_tags]).any?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cuke_iterations-0.0.2 lib/cuke_iterations/scenario_list_generator.rb