You can either add that to test_helper.rb
private
def assert_exception(exception, message=nil, &block)
begin
yield
rescue exception => @e
assert_equal message,@e.message
assert_equal exception,@e.class
end
assert_raises(exception){yield} if @e.blank?
end
So I could do the following
assert_exception(RuntimeError,'SYSTEM ERROR')do
auth.request_data_by_get('entitlementds',
'EntitledFeatures',
false,
{:username => 'blah.blah.shi@db.com'})
end
Its a very nasty hack, not sort of programming like but rather “touched by dark hands of sysadmin” but I needed to be working. So, I guess I want to apologize to the creators of the helper_test plugin, for not being as elegant as they are.
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require File.expand_path(File.dirname(__FILE__) + '/helper_testcase')
require 'test_help'
class StubController < ActionController::Base #ApplicationController
....
include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::PrototypeHelper
def setup
#super
Everything worked like a charm. Thanks again Geoffrey, you made my life so much easier.