Permalink
Browse files

Remove counterintuitive Page#to_s

Conceptually, a Page object is a lot more than just the HTML it
contains; it's also a DOM and a JS state. Hence the counterintuitiveness
of #to_s returning only the document's innerHTML.
  • Loading branch information...
1 parent af87632 commit 3158bf1b3232be7e28f548a05de8519729fc9624 @mynyml committed Feb 15, 2010
Showing with 0 additions and 13 deletions.
  1. +0 −9 lib/harmony/page.rb
  2. +0 −4 test/page_test.rb
View
@@ -110,15 +110,6 @@ def window
def document
window.document
end
-
- # Page's document at current state
- #
- # @return [String]
- # document as string
- #
- def to_s
- document.innerHTML
- end
end
end
View
@@ -53,10 +53,6 @@ class PageTest < MiniTest::Unit::TestCase
assert_empty Page.new.document.title
end
- test "casting to string" do
- assert_equal "<html><head><title></title></head><body></body></html>", Page.new.to_s
- end
-
test "loads javascript file" do
path = tempfile(<<-HTML)
function foo() { return 'bar' };

0 comments on commit 3158bf1

Please sign in to comment.