Sha256: 6b5f8e17fd99edfc1cccdbbb7b5bf452e9f57771c0aafeb93d7d67b9abcc038e

Contents?: true

Size: 770 Bytes

Versions: 5

Compression:

Stored size: 770 Bytes

Contents

require 'pork'

module Pork
  module Sequential
    def sequential stat=Stat.new, paths=nil
      if paths
        require 'pork/isolate'
        paths.inject(stat, &method(:isolate))
      else # maybe we could remove this mode if it's not faster and lighter
        sequential_with_env(stat)
      end
    end

    protected
    def sequential_with_env stat, super_env=nil
      env = Env.new(super_env)
      @tests.each do |(type, arg, test)|
        case type
        when :before
          env.before << arg
        when :after
          env.after  << arg
        when :describe
          arg.sequential_with_env(stat, env)
        when :would
          run(stat, arg, test, env)
        end
      end

      stat
    end
  end

  Executor.extend(Sequential)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pork-1.4.4 lib/pork/mode/sequential.rb
pork-1.4.3 lib/pork/mode/sequential.rb
pork-1.4.2 lib/pork/mode/sequential.rb
pork-1.4.1 lib/pork/mode/sequential.rb
pork-1.4.0 lib/pork/mode/sequential.rb