Skip to content

Commit

Permalink
fix tests to pass with latest Nokogiri
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Dec 25, 2010
1 parent 849b6d2 commit dacf079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def body
end

def assert_body(value)
assert_equal value.strip, body.strip
assert_equal value.lstrip.gsub(/\s*\n\s*/, ""), body.lstrip.gsub(/\s*\n\s*/, "")
end

# Delegate other missing methods to response.
Expand Down
10 changes: 5 additions & 5 deletions test/nokogiri_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def nokogiri_app(&block)
it 'renders inline Nokogiri strings' do
nokogiri_app { nokogiri 'xml' }
assert ok?
assert_equal %{<?xml version="1.0"?>\n}, body
assert_body %{<?xml version="1.0"?>\n}
end

it 'renders inline blocks' do
Expand All @@ -26,7 +26,7 @@ def nokogiri_app(&block)
end
end
assert ok?
assert_equal "<?xml version=\"1.0\"?>\n<couple>Frank &amp; Mary</couple>\n", body
assert_body "<?xml version=\"1.0\"?>\n<couple>Frank &amp; Mary</couple>\n"
end

it 'renders .nokogiri files in views path' do
Expand All @@ -35,7 +35,7 @@ def nokogiri_app(&block)
nokogiri :hello
end
assert ok?
assert_equal %(<?xml version="1.0"?>\n<exclaim>You're my boy, Blue!</exclaim>\n), body
assert_body %(<?xml version="1.0"?>\n<exclaim>You're my boy, Blue!</exclaim>\n)
end

it "renders with inline layouts" do
Expand All @@ -46,7 +46,7 @@ def nokogiri_app(&block)
end
get '/'
assert ok?
assert_equal "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n", body
assert_body "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n"
end

it "renders with file layouts" do
Expand All @@ -56,7 +56,7 @@ def nokogiri_app(&block)
nokogiri %(xml.em 'Hello World'), :layout => :layout2
end
assert ok?
assert_equal "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n", body
assert_body "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n"
end

it "raises error if template not found" do
Expand Down

0 comments on commit dacf079

Please sign in to comment.