aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-06-07 21:39:55 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2011-06-08 00:26:09 -0300
commit1d3618a9b47d3160af00992756a4487906e39bcb (patch)
tree9ab0d0b449229f4a470f57f337ce133ed9b48932 /actionpack/test/template
parentf2f63bf2ffa00d6187405c5851713d9fee68d5d3 (diff)
downloadrails-1d3618a9b47d3160af00992756a4487906e39bcb.tar.gz
rails-1d3618a9b47d3160af00992756a4487906e39bcb.tar.bz2
rails-1d3618a9b47d3160af00992756a4487906e39bcb.zip
remove warning: assigned but unused variable
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/html-scanner/document_test.rb4
-rw-r--r--actionpack/test/template/record_tag_helper_test.rb2
-rw-r--r--actionpack/test/template/render_test.rb4
-rw-r--r--actionpack/test/template/template_test.rb1
-rw-r--r--actionpack/test/template/text_helper_test.rb4
5 files changed, 6 insertions, 9 deletions
diff --git a/actionpack/test/template/html-scanner/document_test.rb b/actionpack/test/template/html-scanner/document_test.rb
index ddfb351595..3db2fba783 100644
--- a/actionpack/test/template/html-scanner/document_test.rb
+++ b/actionpack/test/template/html-scanner/document_test.rb
@@ -123,7 +123,7 @@ HTML
def test_parse_invalid_document
assert_nothing_raised do
- doc = HTML::Document.new("<html>
+ HTML::Document.new("<html>
<table>
<tr>
<td style=\"color: #FFFFFF; height: 17px; onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" style=\"cursor:pointer; height: 17px;\"; nowrap onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" onmouseout=\"this.bgColor='#0066cc'; this.style.color='#FFFFFF'\" onmouseover=\"this.bgColor='#ffffff'; this.style.color='#0033cc'\">About Us</td>
@@ -135,7 +135,7 @@ HTML
def test_invalid_document_raises_exception_when_strict
assert_raise RuntimeError do
- doc = HTML::Document.new("<html>
+ HTML::Document.new("<html>
<table>
<tr>
<td style=\"color: #FFFFFF; height: 17px; onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" style=\"cursor:pointer; height: 17px;\"; nowrap onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" onmouseout=\"this.bgColor='#0066cc'; this.style.color='#FFFFFF'\" onmouseover=\"this.bgColor='#ffffff'; this.style.color='#0033cc'\">About Us</td>
diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb
index 74d7bba4fe..1ba14e8bc9 100644
--- a/actionpack/test/template/record_tag_helper_test.rb
+++ b/actionpack/test/template/record_tag_helper_test.rb
@@ -48,14 +48,12 @@ class RecordTagHelperTest < ActionView::TestCase
end
def test_block_works_with_content_tag_for_in_erb
- __in_erb_template = ''
expected = %(<tr class="post" id="post_45">#{@post.body}</tr>)
actual = content_tag_for(:tr, @post) { concat @post.body }
assert_dom_equal expected, actual
end
def test_div_for_in_erb
- __in_erb_template = ''
expected = %(<div class="post bar" id="post_45">#{@post.body}</div>)
actual = div_for(@post, :class => "bar") { concat @post.body }
assert_dom_equal expected, actual
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 86d08a43a5..4187a0ac78 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -370,7 +370,7 @@ class LazyViewRenderTest < ActiveSupport::TestCase
def test_render_utf8_template_with_incompatible_external_encoding
with_external_encoding Encoding::SHIFT_JIS do
begin
- result = @view.render(:file => "test/utf8.html.erb", :layouts => "layouts/yield")
+ @view.render(:file => "test/utf8.html.erb", :layouts => "layouts/yield")
flunk 'Should have raised incompatible encoding error'
rescue ActionView::Template::Error => error
assert_match 'Your template was not saved as valid Shift_JIS', error.original_exception.message
@@ -381,7 +381,7 @@ class LazyViewRenderTest < ActiveSupport::TestCase
def test_render_utf8_template_with_partial_with_incompatible_encoding
with_external_encoding Encoding::SHIFT_JIS do
begin
- result = @view.render(:file => "test/utf8_magic_with_bare_partial.html.erb", :layouts => "layouts/yield")
+ @view.render(:file => "test/utf8_magic_with_bare_partial.html.erb", :layouts => "layouts/yield")
flunk 'Should have raised incompatible encoding error'
rescue ActionView::Template::Error => error
assert_match 'Your template was not saved as valid Shift_JIS', error.original_exception.message
diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb
index 81fb34b80f..b0ca7de0b6 100644
--- a/actionpack/test/template/template_test.rb
+++ b/actionpack/test/template/template_test.rb
@@ -153,7 +153,6 @@ class TestERBTemplate < ActiveSupport::TestCase
def test_encoding_can_be_specified_with_magic_comment_in_erb
with_external_encoding Encoding::UTF_8 do
@template = new_template("<%# encoding: ISO-8859-1 %>hello \xFCmlat", :virtual_path => nil)
- result = render
assert_equal Encoding::UTF_8, render.encoding
assert_equal "hello \u{fc}mlat", render
end
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 740f577a6e..5a43b5f864 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -291,7 +291,7 @@ class TextHelperTest < ActionView::TestCase
end
def test_cycle_class_with_no_arguments
- assert_raise(ArgumentError) { value = Cycle.new() }
+ assert_raise(ArgumentError) { Cycle.new }
end
def test_cycle
@@ -304,7 +304,7 @@ class TextHelperTest < ActionView::TestCase
end
def test_cycle_with_no_arguments
- assert_raise(ArgumentError) { value = cycle() }
+ assert_raise(ArgumentError) { cycle }
end
def test_cycle_resets_with_new_values