Skip to content

Commit

Permalink
Remove tag since it is semantically dubious and can easily be expre…
Browse files Browse the repository at this point in the history
…ssed by an axis expression
  • Loading branch information
jnicklas committed Jan 3, 2012
1 parent 8a1d188 commit 3f542c1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions lib/xpath/dsl.rb
Expand Up @@ -45,10 +45,6 @@ def string
Expression.new(:string_function, current)
end

def tag(name)
Expression.new(:tag, name)
end

def css(selector)
Expression.new(:css, current, Literal.new(selector))
end
Expand Down
4 changes: 0 additions & 4 deletions lib/xpath/renderer.rb
Expand Up @@ -158,10 +158,6 @@ def inverse(current)
"not(#{current})"
end

def tag(current)
"self::#{current}"
end

def string_function(current)
"string(#{current})"
end
Expand Down
8 changes: 0 additions & 8 deletions spec/xpath_spec.rb
Expand Up @@ -103,14 +103,6 @@ def xpath(predicate=nil, &block)
end
end

describe '#tag' do
it "should filter elements by tag" do
@results = xpath { |x| x.descendant[x.tag(:p) | x.tag(:li)] }
@results[0].text.should == 'Blah'
@results[3].text.should == 'A list'
end
end

describe '#contains' do
it "should find nodes that contain the given string" do
@results = xpath do |x|
Expand Down

0 comments on commit 3f542c1

Please sign in to comment.