lib/macros4cuke/exceptions.rb in macros4cuke-0.3.15 vs lib/macros4cuke/exceptions.rb in macros4cuke-0.3.16
- old
+ new
@@ -28,11 +28,12 @@
# 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.")
+ msg = "The sub-step argument '#{anArgName}' does not appear in the phrase."
+ super(msg)
end
end # class
@@ -44,12 +45,13 @@
end # class
# Raised when an argument name contains invalid characters.
class InvalidCharError < Macros4CukeError
- def initialize(aText, aWrongChar)
- super("The invalid sign '#{aWrongChar}' occurs in the argument/tag '#{aText}'.")
+ def initialize(aTag, aWrongChar)
+ msg = "The invalid sign '#{aWrongChar}' occurs in the argument '#{aTag}'."
+ super(msg)
end
end # class
# Raised when one invokes a macro-step with an unknown phrase.
@@ -71,13 +73,16 @@
# 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.")
+ def initialize(phrase)
+ msg = "The step with phrase [#{phrase}]: requires a data table."
+ super(msg)
end
end # class
+
+ msg =
# Raised when Macros4Cuke encountered an issue
# that it can't handle properly.
\ No newline at end of file