Sha256: 14e0e00d949c9c7165e439a7066a68414a28dab1664529110db5438e79c51e93

Contents?: true

Size: 795 Bytes

Versions: 73

Compression:

Stored size: 795 Bytes

Contents

module Inferno
  module Entities
    module HasRunnable
      # Returns the Test, TestGroup, or TestSuite associated with this entity
      #
      # @return [Inferno::Entities::Test, Inferno::Entities::TestGroup, Inferno::Entities::TestSuite]
      def runnable
        return @runnable if @runnable

        @runnable = (test || test_group || test_suite || load_runnable)
      end

      private

      def load_runnable
        if test_id.present?
          @test = Inferno::Repositories::Tests.new.find(test_id)
        elsif test_group_id.present?
          @test_group = Inferno::Repositories::TestGroups.new.find(test_group_id)
        elsif test_suite_id.present?
          @test_suite = Inferno::Repositories::TestSuites.new.find(test_suite_id)
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
inferno_core-0.4.43 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.42 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.41 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.40 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.39 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.38 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.35 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.34 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.33 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.32 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.31 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.30 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.29 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.28 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.27 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.26 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.25 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.24 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.23 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.22 lib/inferno/entities/has_runnable.rb