Permalink
Browse files

move element_not_found message to its own method

remove not needed return
  • Loading branch information...
1 parent ed4a06c commit 7925c8afe15525f9a026e8bf4952167abbf3f84b @despo despo committed Feb 11, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/prickle/capybara/element.rb
@@ -22,7 +22,7 @@ def initialize type=OF_ANY_TYPE, identifier
end
def identifier
- return @identifier.each_pair.to_a.map { |k, v| "@#{k}='#{v}'" }.join " and "
+ @identifier.each_pair.to_a.map { |k, v| "@#{k}='#{v}'" }.join " and "
end
def type
@@ -51,12 +51,15 @@ def handle_exception &block
begin
block.call
rescue Exception => e
- error_message = Error.new(@type, @identifier, @text, e).message
- raise ElementNotFound, error_message if e.class.to_s == "Capybara::ElementNotFound"
+ raise ElementNotFound, element_not_found_message if e.class == ::Capybara::ElementNotFound
raise
end
end
+ def element_not_found_message
+ Error.new(@type, @identifier, @text, e).message
+ end
+
public
include Prickle::Capybara::Actions

0 comments on commit 7925c8a

Please sign in to comment.