lib/music-transcription/change.rb in music-transcription-0.7.3 vs lib/music-transcription/change.rb in music-transcription-0.8.0

- old
+ new

@@ -23,25 +23,25 @@ super(value,0) end def ensure_zero_duration unless @duration == 0 - raise ValueNotZeroError, "immediate change duration #{self.duration} must be 0" + raise NonZeroError, "immediate change duration #{self.duration} must be 0" end end end class Gradual < Change include Validatable def initialize value, transition_duration - @check_methods = [ :ensure_positive_duration ] + @check_methods = [ :ensure_nonnegative_duration ] super(value, transition_duration) end - def ensure_positive_duration + def ensure_nonnegative_duration if @duration < 0 - raise ValueNotPositiveError, "gradual change duration #{self.duration} must be >= 0" + raise NegativeError, "gradual change duration #{self.duration} must be non-negative" end end end end \ No newline at end of file