lib/watir/elements/button.rb in watir-6.14.0 vs lib/watir/elements/button.rb in watir-6.15.0

- old
+ new

@@ -4,11 +4,11 @@ # # This class covers both <button> and <input type="submit|reset|image|button" /> elements. # class Button < HTMLElement - inherit_attributes_from Watir::Input + inherit_attributes_from Input VALID_TYPES = %w[button reset submit image].freeze # # Returns the text of the button. @@ -18,18 +18,9 @@ # # @return [String] # def text - tn = tag_name - - case tn - when 'input' - value - when 'button' - super - else - raise Exception::Error, "unknown tag name for button: #{tn}" - end + tag_name == 'input' ? value : super end end # Button end # Watir