README.txt in faultinjection-0.0.1 vs README.txt in faultinjection-0.0.2

- old
+ new

@@ -11,19 +11,31 @@ - Fault injection is one of testing techniques. It makes easier to test your application's error handling behavior or to improve the coverage of your tests. See http://en.wikipedia.org/wiki/Fault_injection for more details. + * What can I do with fault_injection.rb ? + + - You can raise error at any line of code or particular method call + without changing the target code. + * Cat it be used with Ruby on Rails testing? + + - It should, but it's not yet tested well with big applications. + Please try and feel free to send me a bug report. + * Can I use it in my application code? - No. It is for your testing code. * Can I use it everywhere in my test code? - You should not. It is for some limited situation that rarely happen or difficult to set up (ex. IOError). If you can make 'evil situation' easily, that's better ;) + + In addition, fault_injection.rb uses set_trace_func API of ruby and + it makes a script much slower. ** Installing $ sudo gem install faultinjection @@ -40,18 +52,18 @@ end end __END__ # test.rb + require 'rubygems' require 'fault_injection' - include FaultInjection - inject "Foo#foo > Kernel#puts", IOError, "IO error" + FaultInjection.inject "Foo#foo > Kernel#puts", IOError, "IO error" f = Foo.new f.foo #=> IOError - inject "sample.rb:7",ZeroDivisionError + FaultInjection.inject "sample.rb:7",ZeroDivisionError f.bar #=> ZeroDivisionError __END__