aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 04:58:27 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 04:58:27 +0000
commit3cf7a0a46037f32b95b5ffb358cb898233d5c5db (patch)
tree7a780b46eedb55daa761296005b163fdeea5f3e4 /actionpack/test/template
parent4b53e26ef612d870a01e646c45bcc4198ad3bd1a (diff)
downloadrails-3cf7a0a46037f32b95b5ffb358cb898233d5c5db.tar.gz
rails-3cf7a0a46037f32b95b5ffb358cb898233d5c5db.tar.bz2
rails-3cf7a0a46037f32b95b5ffb358cb898233d5c5db.zip
Added Kernel#silence_warnings and puts it into use throughout the framework
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/form_helper_test.rb14
-rw-r--r--actionpack/test/template/form_options_helper_test.rb12
2 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 1b9df865f3..9cc89a5860 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -6,14 +6,14 @@ require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/cor
class FormHelperTest < Test::Unit::TestCase
include ActionView::Helpers::FormHelper
- old_verbose, $VERBOSE = $VERBOSE, nil
- Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost)
- Post.class_eval do
- alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
- alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
- alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
+ silence_warnings do
+ Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost)
+ Post.class_eval do
+ alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
+ alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
+ alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
+ end
end
- $VERBOSE = old_verbose
def setup
@post = Post.new
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb
index 7a83f57341..d92a01a4e3 100644
--- a/actionpack/test/template/form_options_helper_test.rb
+++ b/actionpack/test/template/form_options_helper_test.rb
@@ -25,12 +25,12 @@ ActionView::Helpers::FormOptionsHelper::TimeZone = MockTimeZone
class FormOptionsHelperTest < Test::Unit::TestCase
include ActionView::Helpers::FormOptionsHelper
- old_verbose, $VERBOSE = $VERBOSE, nil
- Post = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin)
- Continent = Struct.new('Continent', :continent_name, :countries)
- Country = Struct.new('Country', :country_id, :country_name)
- Firm = Struct.new('Firm', :time_zone)
- $VERBOSE = old_verbose
+ silence_warnings do
+ Post = Struct.new('Post', :title, :author_name, :body, :secret, :written_on, :category, :origin)
+ Continent = Struct.new('Continent', :continent_name, :countries)
+ Country = Struct.new('Country', :country_id, :country_name)
+ Firm = Struct.new('Firm', :time_zone)
+ end
def test_collection_options
@posts = [