lib/macros4cuke/exceptions.rb in macros4cuke-0.2.09 vs lib/macros4cuke/exceptions.rb in macros4cuke-0.2.10

- old
+ new

@@ -13,12 +13,29 @@ def initialize(aPhrase) super("A macro-step with phrase '[#{aPhrase}' already exist.") end end # class +# Raised when one defines an argument name in a macro-step's phrase +# and that argument name does not appear in any sub-step. +class UselessPhraseArgument < Macros4CukeError + def initialize(anArgName) + super("The phrase argument '#{anArgName}' does not appear in a sub-step.") + end +end # class + +# Raised when one defines an argument name in a macro-step's phrase +# and that argument name does not appear in any sub-step. +class UnreachableSubstepArgument < Macros4CukeError + def initialize(anArgName) + super("The sub-step argument '#{anArgName}' does not appear in the phrase.") + end +end # class + + # Raised when one invokes a macro-step with an unknown phrase. class UnknownMacroError < Macros4CukeError def initialize(aPhrase) super("Unknown macro-step with phrase: '[#{aPhrase}'.") end @@ -28,12 +45,22 @@ # Raised when one invokes a macro-step with an argument # that has an unknown name. class UnknownArgumentError < Macros4CukeError def initialize(argName) - super("Unknown macro-ste argument '#{argName}'.") + super("Unknown macro-step argument '#{argName}'.") end end # class + + + +# Raised when one invokes a macro-step without a required data table argument +class DataTableNotFound < Macros4CukeError + def initialize(argName) + super("The macro-step is missing a data table argument.") + end +end # class + # Raised when Macros4Cuke encountered an issue # that it can't handle properly. class InternalError < Macros4CukeError \ No newline at end of file