lib/spy/exceptions.rb in spy-0.2.5 vs lib/spy/exceptions.rb in spy-0.3.0
- old
+ new
@@ -1,33 +1,33 @@
module Spy
class Error < StandardError; end
class AlreadyStubbedError < Error
- def message
- "Spy is already stubbed."
+ def to_s
+ @mesg || "Spy is already stubbed."
end
end
class AlreadyHookedError < Error
- def message
- "Spy is already hooked."
+ def to_s
+ @mesg || "Spy is already hooked."
end
end
class NotHookedError < Error
- def message
- "Spy was not hooked."
+ def to_s
+ @mesg || "Spy was not hooked."
end
end
class NeverHookedError < Error
- def message
- "Spy was never hooked."
+ def to_s
+ @mesg || "Spy was never hooked."
end
end
class NoSpyError < Error
- def message
- "Spy could not be found"
+ def to_s
+ @mesg || "Spy could not be found"
end
end
end