Sha256: 427e659ef2293d3d8cd3b93dc866b2237085ab092114da5850b5fc7f882835ce

Contents?: true

Size: 748 Bytes

Versions: 19

Compression:

Stored size: 748 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

19 entries across 19 versions & 1 rubygems

Version Path
lopata-0.1.32 lib/lopata/loader.rb
lopata-0.1.31 lib/lopata/loader.rb
lopata-0.1.30 lib/lopata/loader.rb
lopata-0.1.29 lib/lopata/loader.rb
lopata-0.1.28 lib/lopata/loader.rb
lopata-0.1.27 lib/lopata/loader.rb
lopata-0.1.26 lib/lopata/loader.rb
lopata-0.1.25 lib/lopata/loader.rb
lopata-0.1.24 lib/lopata/loader.rb
lopata-0.1.23 lib/lopata/loader.rb
lopata-0.1.22 lib/lopata/loader.rb
lopata-0.1.21 lib/lopata/loader.rb
lopata-0.1.20 lib/lopata/loader.rb
lopata-0.1.19 lib/lopata/loader.rb
lopata-0.1.18 lib/lopata/loader.rb
lopata-0.1.17 lib/lopata/loader.rb
lopata-0.1.16 lib/lopata/loader.rb
lopata-0.1.15 lib/lopata/loader.rb
lopata-0.1.14 lib/lopata/loader.rb