Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move element_not_found message to its own method

remove not needed return
  • Loading branch information...
commit 7925c8afe15525f9a026e8bf4952167abbf3f84b 1 parent ed4a06c
Despo Pentara despo authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/prickle/capybara/element.rb
9 lib/prickle/capybara/element.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.