Sha256: 2dfa663a71ecb27eb5066905e8731094189cb52936c23413f450f4784c36c84e

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

module TraceView
  module Test
    class << self
      ##
      # load_extras
      #
      # This method simply loads all the extras needed to run
      # tests such as models, jobs etc...
      #
      def load_extras
        # If we're using the libraries gemfile (with sidekiq and resque)
        if TV::Test.gemfile?(:libraries)
          # Load all of the test workers
          pattern = File.join(File.dirname(__FILE__), '../../test/jobs/**/', '*.rb')
          Dir.glob(pattern) do |f|
            TV.logger.debug "Loading test job file: #{File.basename(f)}"
            require f
          end
        end
      end

      ##
      # gemfile?
      #
      # Method used to determine under which gemfile we're running.
      # Pass <tt>name</tt> as the gemfile name only (without the
      # .gemfile extension)
      #
      # returns true or fase depending on result
      #
      def gemfile?(name)
        File.basename(ENV['BUNDLE_GEMFILE']) == (name.to_s + '.gemfile')
      end

      ##
      # gemfile
      #
      # Used to determine under which gemfile we are running.  This
      # method will return the name of the active gemfile
      #
      def gemfile
        File.basename(ENV['BUNDLE_GEMFILE']).split('.').first
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
traceview-3.6.0-java lib/traceview/test.rb
traceview-3.6.0 lib/traceview/test.rb
traceview-3.5.1-java lib/traceview/test.rb
traceview-3.5.1 lib/traceview/test.rb
traceview-3.5.0-java lib/traceview/test.rb
traceview-3.5.0 lib/traceview/test.rb
traceview-3.4.2-java lib/traceview/test.rb
traceview-3.4.2 lib/traceview/test.rb
traceview-3.4.1-java lib/traceview/test.rb
traceview-3.4.1 lib/traceview/test.rb
traceview-3.4.0-java lib/traceview/test.rb
traceview-3.4.0 lib/traceview/test.rb