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.2 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.2.pre lib/inferno/entities/has_runnable.rb
inferno_core-0.4.1 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.1.pre2 lib/inferno/entities/has_runnable.rb
inferno_core-0.4.1.pre lib/inferno/entities/has_runnable.rb
inferno_core-0.4.0 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.12 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.11 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.10 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.9 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.8 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.7 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.6 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.5 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.4 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.3 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.2 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.1 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.0 lib/inferno/entities/has_runnable.rb
inferno_core-0.3.0.rc1 lib/inferno/entities/has_runnable.rb