class HpricotMock
def initialize title, *args
@title = title
@path = args.map(&:to_s) * '/'
end
def XML *args
self.class.new @title, *args
end
def /(arg)
self.class.new @title, @path, arg
end
def each &block
self.[].each &block
end
def [](*args)
([self.class.new(@title, @path)]*10)
end
def to_s
"[#{@title}: #{@path[1..-1]}]"
end
def empty?
false
end
def size
10
end
def *(whatever)
self
end
alias :inspect :to_s
alias :innerHTML :to_s
end