Sha256: bf1597f4bc8471f347f7c713d6d22f959291033ef22900d55cc346a62e5bee81

Contents?: true

Size: 1.99 KB

Versions: 8

Compression:

Stored size: 1.99 KB

Contents

module Inferno
  module Exceptions
    class TestResultException < RuntimeError
    end

    class AssertionException < TestResultException
      def result
        'fail'
      end
    end

    class SkipException < TestResultException
      def result
        'skip'
      end
    end

    class OmitException < TestResultException
      def result
        'omit'
      end
    end

    class PassException < TestResultException
      def result
        'pass'
      end
    end

    class WaitException < TestResultException
      def result
        'wait'
      end
    end

    class CancelException < TestResultException
      def result
        'cancel'
      end
    end

    class ParentNotLoadedException < RuntimeError
      def initialize(klass, id)
        super("No #{klass.name.demodulize} found with id '#{id}'")
      end
    end

    class ValidatorNotFoundException < RuntimeError
      def initialize(validator_name)
        super("No '#{validator_name}' validator found")
      end
    end

    class RequiredInputsNotFound < RuntimeError
      def initialize(missing_inputs)
        super("Missing the following required inputs: #{missing_inputs.join(', ')}")
      end
    end

    class NotUserRunnableException < RuntimeError
      def initialize
        super('The chosen runnable must be run as part of a group')
      end
    end

    class UnknownAttributeException < RuntimeError
      def initialize(attributes, klass)
        attributes_string = attributes.map { |attribute| "'#{attribute}'" }.join(', ')
        super("Unknown attributes for #{klass.name}: #{attributes_string}")
      end
    end

    class UnknownSessionDataType < RuntimeError
      def initialize(output)
        super("Unknown type '#{output[:type]}' for '#{output[:name]}'.")
      end
    end

    class BadSessionDataType < RuntimeError
      def initialize(name, expected_class_names, actual_class)
        super("Expected '#{name}' to be a #{expected_class_names}, but found a #{actual_class.name}.")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inferno_core-0.4.20 lib/inferno/exceptions.rb
inferno_core-0.4.18 lib/inferno/exceptions.rb
inferno_core-0.4.17 lib/inferno/exceptions.rb
inferno_core-0.4.16 lib/inferno/exceptions.rb
inferno_core-0.4.15 lib/inferno/exceptions.rb
inferno_core-0.4.14 lib/inferno/exceptions.rb
inferno_core-0.4.13 lib/inferno/exceptions.rb
inferno_core-0.4.12 lib/inferno/exceptions.rb