Permalink
Browse files

More specs

  • Loading branch information...
1 parent 1787c4f commit 2d6230706c5091f134b407d137d5dd35d91f896c @wycats committed Oct 22, 2008
Showing with 24 additions and 9 deletions.
  1. +15 −0 spec/attribute_star_equals_spec.rb
  2. 0 spec/class_spec.rb
  3. +5 −5 spec/element_spec.rb
  4. +4 −4 spec/spec_helper.rb
@@ -0,0 +1,15 @@
+require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
+
+describe "*=" do
+ it "<[foo*=ar]> should return a list of all nodes with the element" do
+ HTML.should have_nodes("[foo*=ar]", 4)
+ end
+
+ it "<[foo*='ar']> should return a list of all nodes with the element" do
+ HTML.should have_nodes("[foo*='ar']", 4)
+ end
+
+ it "<[foo*=\"ar\"]> should return a list of all nodes with the element" do
+ HTML.should have_nodes("[foo*=\"ar\"]", 4)
+ end
+end
View
No changes.
View
@@ -1,12 +1,12 @@
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
-describe "Elements" do
- it "<E> should return a list of all nodes with the element" do
- HTML.should have_nodes("span", 4)
+describe "classes" do
+ it "<E.foo> should return a list of all nodes with the element" do
+ HTML.should have_nodes("span.foo", 2)
end
- it "<E> should return a list of all nodes with the element" do
+ it "<.foo> should return a list of all nodes with the element" do
pending
- HTML.should have_nodes("SPAN", 4)
+ HTML.should have_nodes(".foo", 3)
end
end
View
@@ -4,10 +4,10 @@
HTML = <<HERE
<html>
<body>
- <div foo='bar'>Hello
- <span foo='bard'>My name</span>
- <span food='bar'>is wycats</span>
- <span foo='bar baz'>Span</span>
+ <div foo='bar' class='foo'>Hello
+ <span foo='bard' class='foo bar'>My name</span>
+ <span food='bar' class='bar foo'>is wycats</span>
+ <span foo='bar baz' class='food'>Span</span>
<span foo='baz bar'>Span</span>
</div>
<p>Some text</p>

0 comments on commit 2d62307

Please sign in to comment.