lib/fault_injection.rb in faultinjection-0.0.1 vs lib/fault_injection.rb in faultinjection-0.0.2

- old
+ new

@@ -5,15 +5,15 @@ module FaultInjection @@injected_faults = nil @@method_stack = Array.new - def inject_fault(*args) - FaultInjection.inject_fault *args + def inject(*args) + FaultInjection.inject *args end - def self.inject_fault(command,error_class=RuntimeError,msg="injected fault") + def self.inject(command,error_class=RuntimeError,msg="injected fault") unless error_class <= Exception raise ArgumentError, "Error class must be a subclass of Exception" end cond = nil @@ -39,9 +39,11 @@ end raise "[BUG] Internal Error. Please report this to the author :)" if cond.nil? @@injected_faults << cond + + true end # delete all injected faults. def self.clear @@injected_faults = nil