website/index.txt in faultinjection-0.0.1 vs website/index.txt in faultinjection-0.0.2
- old
+ new
@@ -7,27 +7,40 @@
A 'fault injection' tool for ruby.
h3. What is a 'fault injection'? What is it used for?
Fault injection is one of testing techniques.
-It makes easier to test your application's error handling behavior or
+It makes it easier to test your application's error handling behavior or
to improve the coverage of your tests.
See <a herf="http://en.wikipedia.org/wiki/Fault_injection">
http://en.wikipedia.org/wiki/Fault_injection
</a> for more details.
+h3. 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.
+
+h3. 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.
+
h3. Can I use it in my application code?
No. It is for your testing code.
h3. 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.
+
h2. Installing
<pre syntax="ruby">sudo gem install faultinjection</pre>
h2. Sample codes
@@ -44,9 +57,10 @@
10 / 2 # this is line 7
end
end
# test.rb
+require 'rubygems'
require 'fault_injection'
include FaultInjection
inject "Foo#foo > Kernel#puts", IOError, "IO error"