Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix tests to pass with latest Nokogiri

  • Loading branch information...
commit dacf07966753ef7a8ef3b631f4e37c210dab785f 1 parent 849b6d2
@rkh rkh authored
Showing with 6 additions and 6 deletions.
  1. +1 −1  test/helper.rb
  2. +5 −5 test/nokogiri_test.rb
View
2  test/helper.rb
@@ -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.
View
10 test/nokogiri_test.rb
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.