Sha256: b2f748c62a1613ee3a1badf09a4927f92b67dc0fd4cfbc3d21c02cc9b51cdcb9

Contents?: true

Size: 1.76 KB

Versions: 10

Compression:

Stored size: 1.76 KB

Contents

# frozen_string_literal: true

module Fixtury
  module Errors

    class Base < StandardError

    end

    class AlreadyDefinedError < Base

      def initialize(name)
        super("An element identified by #{name.inspect} already exists.")
      end

    end

    class CircularDependencyError < Base

      def initialize(name)
        super("One of the dependencies of #{name.inspect} is dependent on #{name.inspect}.")
      end

    end

    class DefinitionExecutionError < Base

      def initialize(pathname, error)
        super("Error while building #{pathname.inspect}: #{error}")
      end

    end

    class SchemaNodeNotDefinedError < Base

      def initialize(pathname, search)
        super("A schema node identified by #{search.inspect} could not be found from #{pathname.inspect}.")
      end

    end

    class SchemaNodeNameInvalidError < Base
      def initialize(parent_name, child_name)
        super("The schema node name #{child_name.inspect} must start with #{parent_name.inspect} to be added to it.")
      end
    end

    class OptionCollisionError < Base

      def initialize(schema_name, option_key, old_value, new_value)
        super("The #{schema_name.inspect} schema #{option_key.inspect} option value of #{old_value.inspect} conflicts with the new value #{new_value.inspect}.")
      end

    end

    class UnrecognizableLocatorError < Base

      def initialize(action, thing)
        super("Locator did not recognize #{thing} during #{action}")
      end

    end

    class IsolatedMutationError < Base

    end

    class UnknownTestDependencyError < Base

    end

    class UnknownDependencyError < Base

      def initialize(defn, key)
        super("#{defn.pathname} does not contain the provided dependency: #{key}")
      end

    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fixtury-2.0.0 lib/fixtury/errors.rb
fixtury-1.0.1 lib/fixtury/errors.rb
fixtury-1.0.0 lib/fixtury/errors.rb
fixtury-1.0.0.beta7 lib/fixtury/errors.rb
fixtury-1.0.0.beta6 lib/fixtury/errors.rb
fixtury-1.0.0.beta5 lib/fixtury/errors.rb
fixtury-1.0.0.beta4 lib/fixtury/errors.rb
fixtury-1.0.0.beta3 lib/fixtury/errors.rb
fixtury-1.0.0.beta2 lib/fixtury/errors.rb
fixtury-1.0.0.beta1 lib/fixtury/errors.rb