So, comments on the original post indicate the answer:
Kernel.send(:define_method, :puts) { |*args| "" }
Instead of drowning out all the output, I would just disconnect the output from the specific objects that are placed during your tests.
class TestClass def some_method ... puts "something" end end it "should do something expected" do TestClass.send(:define_method, :puts) { |*args| "" } test_class.some_method.should == "abc123" end
source share