From 1e7e977ec41ff9d2794ec81f118a78b6221d4242 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 30 Nov 2008 01:27:24 -0500 Subject: [PATCH] Moving #path method up to Webrat::Element --- lib/webrat/core/elements/area.rb | 4 ---- lib/webrat/core/elements/element.rb | 4 ++++ lib/webrat/core/elements/field.rb | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/webrat/core/elements/area.rb b/lib/webrat/core/elements/area.rb index 430915f..5c08bb2 100644 --- a/lib/webrat/core/elements/area.rb +++ b/lib/webrat/core/elements/area.rb @@ -11,10 +11,6 @@ module Webrat @session.request_page(absolute_href, :get, {}) end - def path - Webrat::XML.xpath_to(@element) - end - protected def href diff --git a/lib/webrat/core/elements/element.rb b/lib/webrat/core/elements/element.rb index cb327ea..88b2bd6 100644 --- a/lib/webrat/core/elements/element.rb +++ b/lib/webrat/core/elements/element.rb @@ -17,6 +17,10 @@ module Webrat @element = element end + def path + Webrat::XML.xpath_to(@element) + end + end end \ No newline at end of file diff --git a/lib/webrat/core/elements/field.rb b/lib/webrat/core/elements/field.rb index 20ff342..359e69a 100644 --- a/lib/webrat/core/elements/field.rb +++ b/lib/webrat/core/elements/field.rb @@ -40,10 +40,6 @@ module Webrat Webrat::XML.attribute(@element, "id") end - def path - Webrat::XML.xpath_to(@element) - end - def matches_name?(name) Webrat::XML.attribute(@element, "name") == name.to_s end