Instant Bug to Testcase

Today i found a small new plugin, that offers a simple way to convert bugs to a testcase.

script/plugin install http://svn.extendviget.com/lab/laziness/trunk

Now every failing request will print a small test case to repeat this request, it is not much, but it is a starting point and can be helpful if you have a lot of parameters being passed.

Output:
Laziness
def test_get_rating_edit_should_not_raise_activerecord_recordnotfound_exception
  assert_nothing_raised(ActiveRecord::RecordNotFound) do
    get :edit, {"id"=>"1"}, {:user_id=>nil, :return_to=>"/orders/1"}, {}, {"_session_id"=>["…"]}
  end
end
Patch:

Atm you need to apply this patch to make it work without exception_notification.

#vendor/plugins/laziness/lib/laziness.rb
module Laziness
  begin
    module ExceptionNotifier
      ::ExceptionNotifier.sections << 'laziness'
    end
  rescue
  end

One thought on “Instant Bug to Testcase

  1. Glad you like the plugin, and thanks for the patch, though I ended up going with a slightly different approach to handling the issue.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s