test/all.rb in hypertext-0.0.1 vs test/all.rb in hypertext-0.0.2
- old
+ new
@@ -1,75 +1,75 @@
scope "Hypertext" do
test "text" do
expected = "hello world\n"
- observed = Hypertext.new
- observed.text "hello world"
+ ht = Hypertext.new
+ ht.text "hello world"
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "self-closing tags" do
expected = "<br />\n"
- observed = Hypertext.new
- observed.tag :br
+ ht = Hypertext.new
+ ht.tag :br
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "opening and closing tags" do
expected = "<span>\n hello world\n</span>\n"
- observed = Hypertext.new
- observed.tag :span do |ht|
+ ht = Hypertext.new
+ ht.tag :span do
ht.text "hello world"
end
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "nested tags" do
expected = "<div>\n <p>\n hello world\n </p>\n</div>\n"
- observed = Hypertext.new
- observed.tag :div do |ht|
- ht.tag :p do |ht|
+ ht = Hypertext.new
+ ht.tag :div do
+ ht.tag :p do
ht.text "hello world"
end
end
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "passing a block to Hypertext.new" do
expected = "<br />\n"
- observed = Hypertext.new do |ht|
+ ht = Hypertext.new do |ht|
ht.tag :br
end
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "tags with attributes" do
expected = "<input type=\"text\" name=\"person[name]\" value=\"Foo\" />\n"
- observed = Hypertext.new do |ht|
+ ht = Hypertext.new do |ht|
ht.tag :input, :type => "text", :name => "person[name]", :value => "Foo"
end
- assert_equal expected, observed.to_s
+ assert_equal expected, ht.to_s
end
test "custom indentation" do
expected = "<p>\n....hello world\n</p>\n"
- observed = Hypertext.new do |ht|
- ht.tag :p do |ht|
+ ht = Hypertext.new do |ht|
+ ht.tag :p do
ht.text "hello world"
end
end
- assert_equal expected, observed.to_s("....")
+ assert_equal expected, ht.to_s("....")
end
-end
+end
\ No newline at end of file