Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean up nokogiri unit test.

- Used %(...) for readability.
- Removed unused local variable.
  • Loading branch information...
commit d2f84b1201b5c8a1780222d1ee0792ba9db88972 1 parent 8f7624a
@gaku gaku authored rkh committed
Showing with 5 additions and 6 deletions.
  1. +5 −6 test/nokogiri_test.rb
View
11 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_body %{<?xml version="1.0"?>\n}
+ 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_body "<?xml version=\"1.0\"?>\n<couple>Frank &amp; Mary</couple>\n"
+ 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_body %(<?xml version="1.0"?>\n<exclaim>You're my boy, Blue!</exclaim>\n)
+ assert_body "<?xml version=\"1.0\"?>\n<exclaim>You're my boy, Blue!</exclaim>\n"
end
it "renders with inline layouts" do
@@ -46,17 +46,16 @@ def nokogiri_app(&block)
end
get '/'
assert ok?
- assert_body "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n"
+ assert_body %(<?xml version="1.0"?>\n<layout>\n <em>Hello World</em>\n</layout>\n)
end
it "renders with file layouts" do
next if Tilt::VERSION <= "1.1"
nokogiri_app do
- @name = "Blue"
nokogiri %(xml.em 'Hello World'), :layout => :layout2
end
assert ok?
- assert_body "<?xml version=\"1.0\"?>\n<layout>\n <em>Hello World</em>\n</layout>\n"
+ 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.