Sha256: 2e24f25ae6ccb0d716785369602830a4b9ec38b1e6ffa9b6f4a5f21d095edf82

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

# @private
module Lopata::Loader
  extend self

  # Loads scenarios for running in current session
  #
  # @param args [Array<String>] files to be load.
  #   Mask (e. g. 'scenarios/**/*.rb') is can be passed as well.
  #   All files from default location to be loaded if empty.
  def load_scenarios(*args)
    if args.empty?
      load_all_scenarios
    else
      args.each(&method(:load_by_mask))
    end
  end

  # Loads all scenarios from predefined paths
  def load_all_scenarios
    load_by_mask "scenarios/**/*.rb"
  end

  # Loads all shared steps from predefined paths
  def load_shared_steps
    load_by_mask "shared_steps/**/*rb"
  end

  # @private
  def load_by_mask(mask)
    Dir[mask].each { |f| load File.expand_path(f) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lopata-0.1.13 lib/lopata/loader.rb